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

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

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

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
#[doc = r"Register block"]
#[repr(C)]
pub struct CH {
#[doc = "0x00 - Description cluster: Input positive pin selection for CH\\[n\\]"]
pub pselp: PSELP,
#[doc = "0x04 - Description cluster: Input negative pin selection for CH\\[n\\]"]
pub pseln: PSELN,
#[doc = "0x08 - Description cluster: Input configuration for CH\\[n\\]"]
pub config: CONFIG,
#[doc = "0x0c - Description cluster: High/low limits for event monitoring a channel"]
pub limit: LIMIT,
}
#[doc = "PSELP (rw) register accessor: an alias for `Reg<PSELP_SPEC>`"]
pub type PSELP = crate::Reg<pselp::PSELP_SPEC>;
#[doc = "Description cluster: Input positive pin selection for CH\\[n\\]"]
pub mod pselp;
#[doc = "PSELN (rw) register accessor: an alias for `Reg<PSELN_SPEC>`"]
pub type PSELN = crate::Reg<pseln::PSELN_SPEC>;
#[doc = "Description cluster: Input negative pin selection for CH\\[n\\]"]
pub mod pseln;
#[doc = "CONFIG (rw) register accessor: an alias for `Reg<CONFIG_SPEC>`"]
pub type CONFIG = crate::Reg<config::CONFIG_SPEC>;
#[doc = "Description cluster: Input configuration for CH\\[n\\]"]
pub mod config;
#[doc = "LIMIT (rw) register accessor: an alias for `Reg<LIMIT_SPEC>`"]
pub type LIMIT = crate::Reg<limit::LIMIT_SPEC>;
#[doc = "Description cluster: High/low limits for event monitoring a channel"]
pub mod limit;
+676
View File
@@ -0,0 +1,676 @@
#[doc = "Register `CONFIG` reader"]
pub struct R(crate::R<CONFIG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CONFIG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CONFIG_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CONFIG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CONFIG` writer"]
pub struct W(crate::W<CONFIG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CONFIG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<CONFIG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CONFIG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `RESP` reader - Positive channel resistor control"]
pub type RESP_R = crate::FieldReader<u8, RESP_A>;
#[doc = "Positive channel resistor control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RESP_A {
#[doc = "0: Bypass resistor ladder"]
BYPASS = 0,
#[doc = "1: Pull-down to GND"]
PULLDOWN = 1,
#[doc = "2: Pull-up to VDD"]
PULLUP = 2,
#[doc = "3: Set input at VDD/2"]
VDD1_2 = 3,
}
impl From<RESP_A> for u8 {
#[inline(always)]
fn from(variant: RESP_A) -> Self {
variant as _
}
}
impl RESP_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RESP_A {
match self.bits {
0 => RESP_A::BYPASS,
1 => RESP_A::PULLDOWN,
2 => RESP_A::PULLUP,
3 => RESP_A::VDD1_2,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `BYPASS`"]
#[inline(always)]
pub fn is_bypass(&self) -> bool {
*self == RESP_A::BYPASS
}
#[doc = "Checks if the value of the field is `PULLDOWN`"]
#[inline(always)]
pub fn is_pulldown(&self) -> bool {
*self == RESP_A::PULLDOWN
}
#[doc = "Checks if the value of the field is `PULLUP`"]
#[inline(always)]
pub fn is_pullup(&self) -> bool {
*self == RESP_A::PULLUP
}
#[doc = "Checks if the value of the field is `VDD1_2`"]
#[inline(always)]
pub fn is_vdd1_2(&self) -> bool {
*self == RESP_A::VDD1_2
}
}
#[doc = "Field `RESP` writer - Positive channel resistor control"]
pub type RESP_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CONFIG_SPEC, u8, RESP_A, 2, O>;
impl<'a, const O: u8> RESP_W<'a, O> {
#[doc = "Bypass resistor ladder"]
#[inline(always)]
pub fn bypass(self) -> &'a mut W {
self.variant(RESP_A::BYPASS)
}
#[doc = "Pull-down to GND"]
#[inline(always)]
pub fn pulldown(self) -> &'a mut W {
self.variant(RESP_A::PULLDOWN)
}
#[doc = "Pull-up to VDD"]
#[inline(always)]
pub fn pullup(self) -> &'a mut W {
self.variant(RESP_A::PULLUP)
}
#[doc = "Set input at VDD/2"]
#[inline(always)]
pub fn vdd1_2(self) -> &'a mut W {
self.variant(RESP_A::VDD1_2)
}
}
#[doc = "Field `RESN` reader - Negative channel resistor control"]
pub type RESN_R = crate::FieldReader<u8, RESN_A>;
#[doc = "Negative channel resistor control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RESN_A {
#[doc = "0: Bypass resistor ladder"]
BYPASS = 0,
#[doc = "1: Pull-down to GND"]
PULLDOWN = 1,
#[doc = "2: Pull-up to VDD"]
PULLUP = 2,
#[doc = "3: Set input at VDD/2"]
VDD1_2 = 3,
}
impl From<RESN_A> for u8 {
#[inline(always)]
fn from(variant: RESN_A) -> Self {
variant as _
}
}
impl RESN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RESN_A {
match self.bits {
0 => RESN_A::BYPASS,
1 => RESN_A::PULLDOWN,
2 => RESN_A::PULLUP,
3 => RESN_A::VDD1_2,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `BYPASS`"]
#[inline(always)]
pub fn is_bypass(&self) -> bool {
*self == RESN_A::BYPASS
}
#[doc = "Checks if the value of the field is `PULLDOWN`"]
#[inline(always)]
pub fn is_pulldown(&self) -> bool {
*self == RESN_A::PULLDOWN
}
#[doc = "Checks if the value of the field is `PULLUP`"]
#[inline(always)]
pub fn is_pullup(&self) -> bool {
*self == RESN_A::PULLUP
}
#[doc = "Checks if the value of the field is `VDD1_2`"]
#[inline(always)]
pub fn is_vdd1_2(&self) -> bool {
*self == RESN_A::VDD1_2
}
}
#[doc = "Field `RESN` writer - Negative channel resistor control"]
pub type RESN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CONFIG_SPEC, u8, RESN_A, 2, O>;
impl<'a, const O: u8> RESN_W<'a, O> {
#[doc = "Bypass resistor ladder"]
#[inline(always)]
pub fn bypass(self) -> &'a mut W {
self.variant(RESN_A::BYPASS)
}
#[doc = "Pull-down to GND"]
#[inline(always)]
pub fn pulldown(self) -> &'a mut W {
self.variant(RESN_A::PULLDOWN)
}
#[doc = "Pull-up to VDD"]
#[inline(always)]
pub fn pullup(self) -> &'a mut W {
self.variant(RESN_A::PULLUP)
}
#[doc = "Set input at VDD/2"]
#[inline(always)]
pub fn vdd1_2(self) -> &'a mut W {
self.variant(RESN_A::VDD1_2)
}
}
#[doc = "Field `GAIN` reader - Gain control"]
pub type GAIN_R = crate::FieldReader<u8, GAIN_A>;
#[doc = "Gain control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum GAIN_A {
#[doc = "0: 1/6"]
GAIN1_6 = 0,
#[doc = "1: 1/5"]
GAIN1_5 = 1,
#[doc = "2: 1/4"]
GAIN1_4 = 2,
#[doc = "3: 1/3"]
GAIN1_3 = 3,
#[doc = "4: 1/2"]
GAIN1_2 = 4,
#[doc = "5: 1"]
GAIN1 = 5,
#[doc = "6: 2"]
GAIN2 = 6,
#[doc = "7: 4"]
GAIN4 = 7,
}
impl From<GAIN_A> for u8 {
#[inline(always)]
fn from(variant: GAIN_A) -> Self {
variant as _
}
}
impl GAIN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> GAIN_A {
match self.bits {
0 => GAIN_A::GAIN1_6,
1 => GAIN_A::GAIN1_5,
2 => GAIN_A::GAIN1_4,
3 => GAIN_A::GAIN1_3,
4 => GAIN_A::GAIN1_2,
5 => GAIN_A::GAIN1,
6 => GAIN_A::GAIN2,
7 => GAIN_A::GAIN4,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `GAIN1_6`"]
#[inline(always)]
pub fn is_gain1_6(&self) -> bool {
*self == GAIN_A::GAIN1_6
}
#[doc = "Checks if the value of the field is `GAIN1_5`"]
#[inline(always)]
pub fn is_gain1_5(&self) -> bool {
*self == GAIN_A::GAIN1_5
}
#[doc = "Checks if the value of the field is `GAIN1_4`"]
#[inline(always)]
pub fn is_gain1_4(&self) -> bool {
*self == GAIN_A::GAIN1_4
}
#[doc = "Checks if the value of the field is `GAIN1_3`"]
#[inline(always)]
pub fn is_gain1_3(&self) -> bool {
*self == GAIN_A::GAIN1_3
}
#[doc = "Checks if the value of the field is `GAIN1_2`"]
#[inline(always)]
pub fn is_gain1_2(&self) -> bool {
*self == GAIN_A::GAIN1_2
}
#[doc = "Checks if the value of the field is `GAIN1`"]
#[inline(always)]
pub fn is_gain1(&self) -> bool {
*self == GAIN_A::GAIN1
}
#[doc = "Checks if the value of the field is `GAIN2`"]
#[inline(always)]
pub fn is_gain2(&self) -> bool {
*self == GAIN_A::GAIN2
}
#[doc = "Checks if the value of the field is `GAIN4`"]
#[inline(always)]
pub fn is_gain4(&self) -> bool {
*self == GAIN_A::GAIN4
}
}
#[doc = "Field `GAIN` writer - Gain control"]
pub type GAIN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CONFIG_SPEC, u8, GAIN_A, 3, O>;
impl<'a, const O: u8> GAIN_W<'a, O> {
#[doc = "1/6"]
#[inline(always)]
pub fn gain1_6(self) -> &'a mut W {
self.variant(GAIN_A::GAIN1_6)
}
#[doc = "1/5"]
#[inline(always)]
pub fn gain1_5(self) -> &'a mut W {
self.variant(GAIN_A::GAIN1_5)
}
#[doc = "1/4"]
#[inline(always)]
pub fn gain1_4(self) -> &'a mut W {
self.variant(GAIN_A::GAIN1_4)
}
#[doc = "1/3"]
#[inline(always)]
pub fn gain1_3(self) -> &'a mut W {
self.variant(GAIN_A::GAIN1_3)
}
#[doc = "1/2"]
#[inline(always)]
pub fn gain1_2(self) -> &'a mut W {
self.variant(GAIN_A::GAIN1_2)
}
#[doc = "1"]
#[inline(always)]
pub fn gain1(self) -> &'a mut W {
self.variant(GAIN_A::GAIN1)
}
#[doc = "2"]
#[inline(always)]
pub fn gain2(self) -> &'a mut W {
self.variant(GAIN_A::GAIN2)
}
#[doc = "4"]
#[inline(always)]
pub fn gain4(self) -> &'a mut W {
self.variant(GAIN_A::GAIN4)
}
}
#[doc = "Field `REFSEL` reader - Reference control"]
pub type REFSEL_R = crate::BitReader<REFSEL_A>;
#[doc = "Reference control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REFSEL_A {
#[doc = "0: Internal reference (0.6 V)"]
INTERNAL = 0,
#[doc = "1: VDD/4 as reference"]
VDD1_4 = 1,
}
impl From<REFSEL_A> for bool {
#[inline(always)]
fn from(variant: REFSEL_A) -> Self {
variant as u8 != 0
}
}
impl REFSEL_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> REFSEL_A {
match self.bits {
false => REFSEL_A::INTERNAL,
true => REFSEL_A::VDD1_4,
}
}
#[doc = "Checks if the value of the field is `INTERNAL`"]
#[inline(always)]
pub fn is_internal(&self) -> bool {
*self == REFSEL_A::INTERNAL
}
#[doc = "Checks if the value of the field is `VDD1_4`"]
#[inline(always)]
pub fn is_vdd1_4(&self) -> bool {
*self == REFSEL_A::VDD1_4
}
}
#[doc = "Field `REFSEL` writer - Reference control"]
pub type REFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CONFIG_SPEC, REFSEL_A, O>;
impl<'a, const O: u8> REFSEL_W<'a, O> {
#[doc = "Internal reference (0.6 V)"]
#[inline(always)]
pub fn internal(self) -> &'a mut W {
self.variant(REFSEL_A::INTERNAL)
}
#[doc = "VDD/4 as reference"]
#[inline(always)]
pub fn vdd1_4(self) -> &'a mut W {
self.variant(REFSEL_A::VDD1_4)
}
}
#[doc = "Field `TACQ` reader - Acquisition time, the time the ADC uses to sample the input voltage"]
pub type TACQ_R = crate::FieldReader<u8, TACQ_A>;
#[doc = "Acquisition time, the time the ADC uses to sample the input voltage\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum TACQ_A {
#[doc = "0: 3 us"]
_3US = 0,
#[doc = "1: 5 us"]
_5US = 1,
#[doc = "2: 10 us"]
_10US = 2,
#[doc = "3: 15 us"]
_15US = 3,
#[doc = "4: 20 us"]
_20US = 4,
#[doc = "5: 40 us"]
_40US = 5,
}
impl From<TACQ_A> for u8 {
#[inline(always)]
fn from(variant: TACQ_A) -> Self {
variant as _
}
}
impl TACQ_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<TACQ_A> {
match self.bits {
0 => Some(TACQ_A::_3US),
1 => Some(TACQ_A::_5US),
2 => Some(TACQ_A::_10US),
3 => Some(TACQ_A::_15US),
4 => Some(TACQ_A::_20US),
5 => Some(TACQ_A::_40US),
_ => None,
}
}
#[doc = "Checks if the value of the field is `_3US`"]
#[inline(always)]
pub fn is_3us(&self) -> bool {
*self == TACQ_A::_3US
}
#[doc = "Checks if the value of the field is `_5US`"]
#[inline(always)]
pub fn is_5us(&self) -> bool {
*self == TACQ_A::_5US
}
#[doc = "Checks if the value of the field is `_10US`"]
#[inline(always)]
pub fn is_10us(&self) -> bool {
*self == TACQ_A::_10US
}
#[doc = "Checks if the value of the field is `_15US`"]
#[inline(always)]
pub fn is_15us(&self) -> bool {
*self == TACQ_A::_15US
}
#[doc = "Checks if the value of the field is `_20US`"]
#[inline(always)]
pub fn is_20us(&self) -> bool {
*self == TACQ_A::_20US
}
#[doc = "Checks if the value of the field is `_40US`"]
#[inline(always)]
pub fn is_40us(&self) -> bool {
*self == TACQ_A::_40US
}
}
#[doc = "Field `TACQ` writer - Acquisition time, the time the ADC uses to sample the input voltage"]
pub type TACQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CONFIG_SPEC, u8, TACQ_A, 3, O>;
impl<'a, const O: u8> TACQ_W<'a, O> {
#[doc = "3 us"]
#[inline(always)]
pub fn _3us(self) -> &'a mut W {
self.variant(TACQ_A::_3US)
}
#[doc = "5 us"]
#[inline(always)]
pub fn _5us(self) -> &'a mut W {
self.variant(TACQ_A::_5US)
}
#[doc = "10 us"]
#[inline(always)]
pub fn _10us(self) -> &'a mut W {
self.variant(TACQ_A::_10US)
}
#[doc = "15 us"]
#[inline(always)]
pub fn _15us(self) -> &'a mut W {
self.variant(TACQ_A::_15US)
}
#[doc = "20 us"]
#[inline(always)]
pub fn _20us(self) -> &'a mut W {
self.variant(TACQ_A::_20US)
}
#[doc = "40 us"]
#[inline(always)]
pub fn _40us(self) -> &'a mut W {
self.variant(TACQ_A::_40US)
}
}
#[doc = "Field `MODE` reader - Enable differential mode"]
pub type MODE_R = crate::BitReader<MODE_A>;
#[doc = "Enable differential mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MODE_A {
#[doc = "0: Single ended, PSELN will be ignored, negative input to ADC shorted to GND"]
SE = 0,
#[doc = "1: Differential"]
DIFF = 1,
}
impl From<MODE_A> for bool {
#[inline(always)]
fn from(variant: MODE_A) -> Self {
variant as u8 != 0
}
}
impl MODE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> MODE_A {
match self.bits {
false => MODE_A::SE,
true => MODE_A::DIFF,
}
}
#[doc = "Checks if the value of the field is `SE`"]
#[inline(always)]
pub fn is_se(&self) -> bool {
*self == MODE_A::SE
}
#[doc = "Checks if the value of the field is `DIFF`"]
#[inline(always)]
pub fn is_diff(&self) -> bool {
*self == MODE_A::DIFF
}
}
#[doc = "Field `MODE` writer - Enable differential mode"]
pub type MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CONFIG_SPEC, MODE_A, O>;
impl<'a, const O: u8> MODE_W<'a, O> {
#[doc = "Single ended, PSELN will be ignored, negative input to ADC shorted to GND"]
#[inline(always)]
pub fn se(self) -> &'a mut W {
self.variant(MODE_A::SE)
}
#[doc = "Differential"]
#[inline(always)]
pub fn diff(self) -> &'a mut W {
self.variant(MODE_A::DIFF)
}
}
#[doc = "Field `BURST` reader - Enable burst mode"]
pub type BURST_R = crate::BitReader<BURST_A>;
#[doc = "Enable burst mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BURST_A {
#[doc = "0: Burst mode is disabled (normal operation)"]
DISABLED = 0,
#[doc = "1: Burst mode is enabled. SAADC takes 2^OVERSAMPLE number of samples as fast as it can, and sends the average to Data RAM."]
ENABLED = 1,
}
impl From<BURST_A> for bool {
#[inline(always)]
fn from(variant: BURST_A) -> Self {
variant as u8 != 0
}
}
impl BURST_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> BURST_A {
match self.bits {
false => BURST_A::DISABLED,
true => BURST_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == BURST_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == BURST_A::ENABLED
}
}
#[doc = "Field `BURST` writer - Enable burst mode"]
pub type BURST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CONFIG_SPEC, BURST_A, O>;
impl<'a, const O: u8> BURST_W<'a, O> {
#[doc = "Burst mode is disabled (normal operation)"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(BURST_A::DISABLED)
}
#[doc = "Burst mode is enabled. SAADC takes 2^OVERSAMPLE number of samples as fast as it can, and sends the average to Data RAM."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(BURST_A::ENABLED)
}
}
impl R {
#[doc = "Bits 0:1 - Positive channel resistor control"]
#[inline(always)]
pub fn resp(&self) -> RESP_R {
RESP_R::new((self.bits & 3) as u8)
}
#[doc = "Bits 4:5 - Negative channel resistor control"]
#[inline(always)]
pub fn resn(&self) -> RESN_R {
RESN_R::new(((self.bits >> 4) & 3) as u8)
}
#[doc = "Bits 8:10 - Gain control"]
#[inline(always)]
pub fn gain(&self) -> GAIN_R {
GAIN_R::new(((self.bits >> 8) & 7) as u8)
}
#[doc = "Bit 12 - Reference control"]
#[inline(always)]
pub fn refsel(&self) -> REFSEL_R {
REFSEL_R::new(((self.bits >> 12) & 1) != 0)
}
#[doc = "Bits 16:18 - Acquisition time, the time the ADC uses to sample the input voltage"]
#[inline(always)]
pub fn tacq(&self) -> TACQ_R {
TACQ_R::new(((self.bits >> 16) & 7) as u8)
}
#[doc = "Bit 20 - Enable differential mode"]
#[inline(always)]
pub fn mode(&self) -> MODE_R {
MODE_R::new(((self.bits >> 20) & 1) != 0)
}
#[doc = "Bit 24 - Enable burst mode"]
#[inline(always)]
pub fn burst(&self) -> BURST_R {
BURST_R::new(((self.bits >> 24) & 1) != 0)
}
}
impl W {
#[doc = "Bits 0:1 - Positive channel resistor control"]
#[inline(always)]
pub fn resp(&mut self) -> RESP_W<0> {
RESP_W::new(self)
}
#[doc = "Bits 4:5 - Negative channel resistor control"]
#[inline(always)]
pub fn resn(&mut self) -> RESN_W<4> {
RESN_W::new(self)
}
#[doc = "Bits 8:10 - Gain control"]
#[inline(always)]
pub fn gain(&mut self) -> GAIN_W<8> {
GAIN_W::new(self)
}
#[doc = "Bit 12 - Reference control"]
#[inline(always)]
pub fn refsel(&mut self) -> REFSEL_W<12> {
REFSEL_W::new(self)
}
#[doc = "Bits 16:18 - Acquisition time, the time the ADC uses to sample the input voltage"]
#[inline(always)]
pub fn tacq(&mut self) -> TACQ_W<16> {
TACQ_W::new(self)
}
#[doc = "Bit 20 - Enable differential mode"]
#[inline(always)]
pub fn mode(&mut self) -> MODE_W<20> {
MODE_W::new(self)
}
#[doc = "Bit 24 - Enable burst mode"]
#[inline(always)]
pub fn burst(&mut self) -> BURST_W<24> {
BURST_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Description cluster: Input configuration for CH\\[n\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"]
pub struct CONFIG_SPEC;
impl crate::RegisterSpec for CONFIG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [config::R](R) reader structure"]
impl crate::Readable for CONFIG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"]
impl crate::Writable for CONFIG_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CONFIG to value 0x0002_0000"]
impl crate::Resettable for CONFIG_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x0002_0000
}
}
+94
View File
@@ -0,0 +1,94 @@
#[doc = "Register `LIMIT` reader"]
pub struct R(crate::R<LIMIT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<LIMIT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<LIMIT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<LIMIT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `LIMIT` writer"]
pub struct W(crate::W<LIMIT_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<LIMIT_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<LIMIT_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<LIMIT_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `LOW` reader - Low level limit"]
pub type LOW_R = crate::FieldReader<u16, u16>;
#[doc = "Field `LOW` writer - Low level limit"]
pub type LOW_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LIMIT_SPEC, u16, u16, 16, O>;
#[doc = "Field `HIGH` reader - High level limit"]
pub type HIGH_R = crate::FieldReader<u16, u16>;
#[doc = "Field `HIGH` writer - High level limit"]
pub type HIGH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LIMIT_SPEC, u16, u16, 16, O>;
impl R {
#[doc = "Bits 0:15 - Low level limit"]
#[inline(always)]
pub fn low(&self) -> LOW_R {
LOW_R::new((self.bits & 0xffff) as u16)
}
#[doc = "Bits 16:31 - High level limit"]
#[inline(always)]
pub fn high(&self) -> HIGH_R {
HIGH_R::new(((self.bits >> 16) & 0xffff) as u16)
}
}
impl W {
#[doc = "Bits 0:15 - Low level limit"]
#[inline(always)]
pub fn low(&mut self) -> LOW_W<0> {
LOW_W::new(self)
}
#[doc = "Bits 16:31 - High level limit"]
#[inline(always)]
pub fn high(&mut self) -> HIGH_W<16> {
HIGH_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Description cluster: High/low limits for event monitoring a channel\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [limit](index.html) module"]
pub struct LIMIT_SPEC;
impl crate::RegisterSpec for LIMIT_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [limit::R](R) reader structure"]
impl crate::Readable for LIMIT_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [limit::W](W) writer structure"]
impl crate::Writable for LIMIT_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets LIMIT to value 0x7fff_8000"]
impl crate::Resettable for LIMIT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x7fff_8000
}
}
+232
View File
@@ -0,0 +1,232 @@
#[doc = "Register `PSELN` reader"]
pub struct R(crate::R<PSELN_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PSELN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PSELN_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PSELN_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PSELN` writer"]
pub struct W(crate::W<PSELN_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PSELN_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<PSELN_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PSELN_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `PSELN` reader - Analog negative input, enables differential channel"]
pub type PSELN_R = crate::FieldReader<u8, PSELN_A>;
#[doc = "Analog negative input, enables differential channel\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum PSELN_A {
#[doc = "0: Not connected"]
NC = 0,
#[doc = "1: AIN0"]
ANALOG_INPUT0 = 1,
#[doc = "2: AIN1"]
ANALOG_INPUT1 = 2,
#[doc = "3: AIN2"]
ANALOG_INPUT2 = 3,
#[doc = "4: AIN3"]
ANALOG_INPUT3 = 4,
#[doc = "5: AIN4"]
ANALOG_INPUT4 = 5,
#[doc = "6: AIN5"]
ANALOG_INPUT5 = 6,
#[doc = "7: AIN6"]
ANALOG_INPUT6 = 7,
#[doc = "8: AIN7"]
ANALOG_INPUT7 = 8,
#[doc = "9: VDD"]
VDD = 9,
}
impl From<PSELN_A> for u8 {
#[inline(always)]
fn from(variant: PSELN_A) -> Self {
variant as _
}
}
impl PSELN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<PSELN_A> {
match self.bits {
0 => Some(PSELN_A::NC),
1 => Some(PSELN_A::ANALOG_INPUT0),
2 => Some(PSELN_A::ANALOG_INPUT1),
3 => Some(PSELN_A::ANALOG_INPUT2),
4 => Some(PSELN_A::ANALOG_INPUT3),
5 => Some(PSELN_A::ANALOG_INPUT4),
6 => Some(PSELN_A::ANALOG_INPUT5),
7 => Some(PSELN_A::ANALOG_INPUT6),
8 => Some(PSELN_A::ANALOG_INPUT7),
9 => Some(PSELN_A::VDD),
_ => None,
}
}
#[doc = "Checks if the value of the field is `NC`"]
#[inline(always)]
pub fn is_nc(&self) -> bool {
*self == PSELN_A::NC
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT0`"]
#[inline(always)]
pub fn is_analog_input0(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT0
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT1`"]
#[inline(always)]
pub fn is_analog_input1(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT1
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT2`"]
#[inline(always)]
pub fn is_analog_input2(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT2
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT3`"]
#[inline(always)]
pub fn is_analog_input3(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT3
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT4`"]
#[inline(always)]
pub fn is_analog_input4(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT4
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT5`"]
#[inline(always)]
pub fn is_analog_input5(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT5
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT6`"]
#[inline(always)]
pub fn is_analog_input6(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT6
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT7`"]
#[inline(always)]
pub fn is_analog_input7(&self) -> bool {
*self == PSELN_A::ANALOG_INPUT7
}
#[doc = "Checks if the value of the field is `VDD`"]
#[inline(always)]
pub fn is_vdd(&self) -> bool {
*self == PSELN_A::VDD
}
}
#[doc = "Field `PSELN` writer - Analog negative input, enables differential channel"]
pub type PSELN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PSELN_SPEC, u8, PSELN_A, 5, O>;
impl<'a, const O: u8> PSELN_W<'a, O> {
#[doc = "Not connected"]
#[inline(always)]
pub fn nc(self) -> &'a mut W {
self.variant(PSELN_A::NC)
}
#[doc = "AIN0"]
#[inline(always)]
pub fn analog_input0(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT0)
}
#[doc = "AIN1"]
#[inline(always)]
pub fn analog_input1(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT1)
}
#[doc = "AIN2"]
#[inline(always)]
pub fn analog_input2(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT2)
}
#[doc = "AIN3"]
#[inline(always)]
pub fn analog_input3(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT3)
}
#[doc = "AIN4"]
#[inline(always)]
pub fn analog_input4(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT4)
}
#[doc = "AIN5"]
#[inline(always)]
pub fn analog_input5(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT5)
}
#[doc = "AIN6"]
#[inline(always)]
pub fn analog_input6(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT6)
}
#[doc = "AIN7"]
#[inline(always)]
pub fn analog_input7(self) -> &'a mut W {
self.variant(PSELN_A::ANALOG_INPUT7)
}
#[doc = "VDD"]
#[inline(always)]
pub fn vdd(self) -> &'a mut W {
self.variant(PSELN_A::VDD)
}
}
impl R {
#[doc = "Bits 0:4 - Analog negative input, enables differential channel"]
#[inline(always)]
pub fn pseln(&self) -> PSELN_R {
PSELN_R::new((self.bits & 0x1f) as u8)
}
}
impl W {
#[doc = "Bits 0:4 - Analog negative input, enables differential channel"]
#[inline(always)]
pub fn pseln(&mut self) -> PSELN_W<0> {
PSELN_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Description cluster: Input negative pin selection for CH\\[n\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pseln](index.html) module"]
pub struct PSELN_SPEC;
impl crate::RegisterSpec for PSELN_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [pseln::R](R) reader structure"]
impl crate::Readable for PSELN_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pseln::W](W) writer structure"]
impl crate::Writable for PSELN_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PSELN to value 0"]
impl crate::Resettable for PSELN_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+232
View File
@@ -0,0 +1,232 @@
#[doc = "Register `PSELP` reader"]
pub struct R(crate::R<PSELP_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PSELP_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PSELP_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PSELP_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PSELP` writer"]
pub struct W(crate::W<PSELP_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PSELP_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<PSELP_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PSELP_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `PSELP` reader - Analog positive input channel"]
pub type PSELP_R = crate::FieldReader<u8, PSELP_A>;
#[doc = "Analog positive input channel\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum PSELP_A {
#[doc = "0: Not connected"]
NC = 0,
#[doc = "1: AIN0"]
ANALOG_INPUT0 = 1,
#[doc = "2: AIN1"]
ANALOG_INPUT1 = 2,
#[doc = "3: AIN2"]
ANALOG_INPUT2 = 3,
#[doc = "4: AIN3"]
ANALOG_INPUT3 = 4,
#[doc = "5: AIN4"]
ANALOG_INPUT4 = 5,
#[doc = "6: AIN5"]
ANALOG_INPUT5 = 6,
#[doc = "7: AIN6"]
ANALOG_INPUT6 = 7,
#[doc = "8: AIN7"]
ANALOG_INPUT7 = 8,
#[doc = "9: VDD"]
VDD = 9,
}
impl From<PSELP_A> for u8 {
#[inline(always)]
fn from(variant: PSELP_A) -> Self {
variant as _
}
}
impl PSELP_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<PSELP_A> {
match self.bits {
0 => Some(PSELP_A::NC),
1 => Some(PSELP_A::ANALOG_INPUT0),
2 => Some(PSELP_A::ANALOG_INPUT1),
3 => Some(PSELP_A::ANALOG_INPUT2),
4 => Some(PSELP_A::ANALOG_INPUT3),
5 => Some(PSELP_A::ANALOG_INPUT4),
6 => Some(PSELP_A::ANALOG_INPUT5),
7 => Some(PSELP_A::ANALOG_INPUT6),
8 => Some(PSELP_A::ANALOG_INPUT7),
9 => Some(PSELP_A::VDD),
_ => None,
}
}
#[doc = "Checks if the value of the field is `NC`"]
#[inline(always)]
pub fn is_nc(&self) -> bool {
*self == PSELP_A::NC
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT0`"]
#[inline(always)]
pub fn is_analog_input0(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT0
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT1`"]
#[inline(always)]
pub fn is_analog_input1(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT1
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT2`"]
#[inline(always)]
pub fn is_analog_input2(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT2
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT3`"]
#[inline(always)]
pub fn is_analog_input3(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT3
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT4`"]
#[inline(always)]
pub fn is_analog_input4(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT4
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT5`"]
#[inline(always)]
pub fn is_analog_input5(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT5
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT6`"]
#[inline(always)]
pub fn is_analog_input6(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT6
}
#[doc = "Checks if the value of the field is `ANALOG_INPUT7`"]
#[inline(always)]
pub fn is_analog_input7(&self) -> bool {
*self == PSELP_A::ANALOG_INPUT7
}
#[doc = "Checks if the value of the field is `VDD`"]
#[inline(always)]
pub fn is_vdd(&self) -> bool {
*self == PSELP_A::VDD
}
}
#[doc = "Field `PSELP` writer - Analog positive input channel"]
pub type PSELP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PSELP_SPEC, u8, PSELP_A, 5, O>;
impl<'a, const O: u8> PSELP_W<'a, O> {
#[doc = "Not connected"]
#[inline(always)]
pub fn nc(self) -> &'a mut W {
self.variant(PSELP_A::NC)
}
#[doc = "AIN0"]
#[inline(always)]
pub fn analog_input0(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT0)
}
#[doc = "AIN1"]
#[inline(always)]
pub fn analog_input1(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT1)
}
#[doc = "AIN2"]
#[inline(always)]
pub fn analog_input2(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT2)
}
#[doc = "AIN3"]
#[inline(always)]
pub fn analog_input3(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT3)
}
#[doc = "AIN4"]
#[inline(always)]
pub fn analog_input4(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT4)
}
#[doc = "AIN5"]
#[inline(always)]
pub fn analog_input5(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT5)
}
#[doc = "AIN6"]
#[inline(always)]
pub fn analog_input6(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT6)
}
#[doc = "AIN7"]
#[inline(always)]
pub fn analog_input7(self) -> &'a mut W {
self.variant(PSELP_A::ANALOG_INPUT7)
}
#[doc = "VDD"]
#[inline(always)]
pub fn vdd(self) -> &'a mut W {
self.variant(PSELP_A::VDD)
}
}
impl R {
#[doc = "Bits 0:4 - Analog positive input channel"]
#[inline(always)]
pub fn pselp(&self) -> PSELP_R {
PSELP_R::new((self.bits & 0x1f) as u8)
}
}
impl W {
#[doc = "Bits 0:4 - Analog positive input channel"]
#[inline(always)]
pub fn pselp(&mut self) -> PSELP_W<0> {
PSELP_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Description cluster: Input positive pin selection for CH\\[n\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselp](index.html) module"]
pub struct PSELP_SPEC;
impl crate::RegisterSpec for PSELP_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [pselp::R](R) reader structure"]
impl crate::Readable for PSELP_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pselp::W](W) writer structure"]
impl crate::Writable for PSELP_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PSELP to value 0"]
impl crate::Resettable for PSELP_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+126
View File
@@ -0,0 +1,126 @@
#[doc = "Register `ENABLE` reader"]
pub struct R(crate::R<ENABLE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ENABLE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ENABLE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ENABLE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `ENABLE` writer"]
pub struct W(crate::W<ENABLE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<ENABLE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<ENABLE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<ENABLE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `ENABLE` reader - Enable or disable ADC"]
pub type ENABLE_R = crate::BitReader<ENABLE_A>;
#[doc = "Enable or disable ADC\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ENABLE_A {
#[doc = "0: Disable ADC"]
DISABLED = 0,
#[doc = "1: Enable ADC"]
ENABLED = 1,
}
impl From<ENABLE_A> for bool {
#[inline(always)]
fn from(variant: ENABLE_A) -> Self {
variant as u8 != 0
}
}
impl ENABLE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> ENABLE_A {
match self.bits {
false => ENABLE_A::DISABLED,
true => ENABLE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ENABLE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ENABLE_A::ENABLED
}
}
#[doc = "Field `ENABLE` writer - Enable or disable ADC"]
pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, ENABLE_SPEC, ENABLE_A, O>;
impl<'a, const O: u8> ENABLE_W<'a, O> {
#[doc = "Disable ADC"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ENABLE_A::DISABLED)
}
#[doc = "Enable ADC"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ENABLE_A::ENABLED)
}
}
impl R {
#[doc = "Bit 0 - Enable or disable ADC"]
#[inline(always)]
pub fn enable(&self) -> ENABLE_R {
ENABLE_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Enable or disable ADC"]
#[inline(always)]
pub fn enable(&mut self) -> ENABLE_W<0> {
ENABLE_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Enable or disable ADC\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"]
pub struct ENABLE_SPEC;
impl crate::RegisterSpec for ENABLE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [enable::R](R) reader structure"]
impl crate::Readable for ENABLE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"]
impl crate::Writable for ENABLE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets ENABLE to value 0"]
impl crate::Resettable for ENABLE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+127
View File
@@ -0,0 +1,127 @@
#[doc = "Register `EVENTS_CALIBRATEDONE` reader"]
pub struct R(crate::R<EVENTS_CALIBRATEDONE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_CALIBRATEDONE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_CALIBRATEDONE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_CALIBRATEDONE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_CALIBRATEDONE` writer"]
pub struct W(crate::W<EVENTS_CALIBRATEDONE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_CALIBRATEDONE_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_CALIBRATEDONE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_CALIBRATEDONE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EVENTS_CALIBRATEDONE` reader - Calibration is complete"]
pub type EVENTS_CALIBRATEDONE_R = crate::BitReader<EVENTS_CALIBRATEDONE_A>;
#[doc = "Calibration is complete\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EVENTS_CALIBRATEDONE_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<EVENTS_CALIBRATEDONE_A> for bool {
#[inline(always)]
fn from(variant: EVENTS_CALIBRATEDONE_A) -> Self {
variant as u8 != 0
}
}
impl EVENTS_CALIBRATEDONE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> EVENTS_CALIBRATEDONE_A {
match self.bits {
false => EVENTS_CALIBRATEDONE_A::NOT_GENERATED,
true => EVENTS_CALIBRATEDONE_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == EVENTS_CALIBRATEDONE_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == EVENTS_CALIBRATEDONE_A::GENERATED
}
}
#[doc = "Field `EVENTS_CALIBRATEDONE` writer - Calibration is complete"]
pub type EVENTS_CALIBRATEDONE_W<'a, const O: u8> =
crate::BitWriter<'a, u32, EVENTS_CALIBRATEDONE_SPEC, EVENTS_CALIBRATEDONE_A, O>;
impl<'a, const O: u8> EVENTS_CALIBRATEDONE_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(EVENTS_CALIBRATEDONE_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(EVENTS_CALIBRATEDONE_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - Calibration is complete"]
#[inline(always)]
pub fn events_calibratedone(&self) -> EVENTS_CALIBRATEDONE_R {
EVENTS_CALIBRATEDONE_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Calibration is complete"]
#[inline(always)]
pub fn events_calibratedone(&mut self) -> EVENTS_CALIBRATEDONE_W<0> {
EVENTS_CALIBRATEDONE_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 = "Calibration is complete\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_calibratedone](index.html) module"]
pub struct EVENTS_CALIBRATEDONE_SPEC;
impl crate::RegisterSpec for EVENTS_CALIBRATEDONE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_calibratedone::R](R) reader structure"]
impl crate::Readable for EVENTS_CALIBRATEDONE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_calibratedone::W](W) writer structure"]
impl crate::Writable for EVENTS_CALIBRATEDONE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_CALIBRATEDONE to value 0"]
impl crate::Resettable for EVENTS_CALIBRATEDONE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+16
View File
@@ -0,0 +1,16 @@
#[doc = r"Register block"]
#[repr(C)]
pub struct EVENTS_CH {
#[doc = "0x00 - Description cluster: Last results is equal or above CH\\[n\\].LIMIT.HIGH"]
pub limith: LIMITH,
#[doc = "0x04 - Description cluster: Last results is equal or below CH\\[n\\].LIMIT.LOW"]
pub limitl: LIMITL,
}
#[doc = "LIMITH (rw) register accessor: an alias for `Reg<LIMITH_SPEC>`"]
pub type LIMITH = crate::Reg<limith::LIMITH_SPEC>;
#[doc = "Description cluster: Last results is equal or above CH\\[n\\].LIMIT.HIGH"]
pub mod limith;
#[doc = "LIMITL (rw) register accessor: an alias for `Reg<LIMITL_SPEC>`"]
pub type LIMITL = crate::Reg<limitl::LIMITL_SPEC>;
#[doc = "Description cluster: Last results is equal or below CH\\[n\\].LIMIT.LOW"]
pub mod limitl;
+126
View File
@@ -0,0 +1,126 @@
#[doc = "Register `LIMITH` reader"]
pub struct R(crate::R<LIMITH_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<LIMITH_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<LIMITH_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<LIMITH_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `LIMITH` writer"]
pub struct W(crate::W<LIMITH_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<LIMITH_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<LIMITH_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<LIMITH_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `LIMITH` reader - Last results is equal or above CH\\[n\\].LIMIT.HIGH"]
pub type LIMITH_R = crate::BitReader<LIMITH_A>;
#[doc = "Last results is equal or above CH\\[n\\].LIMIT.HIGH\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LIMITH_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<LIMITH_A> for bool {
#[inline(always)]
fn from(variant: LIMITH_A) -> Self {
variant as u8 != 0
}
}
impl LIMITH_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> LIMITH_A {
match self.bits {
false => LIMITH_A::NOT_GENERATED,
true => LIMITH_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == LIMITH_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == LIMITH_A::GENERATED
}
}
#[doc = "Field `LIMITH` writer - Last results is equal or above CH\\[n\\].LIMIT.HIGH"]
pub type LIMITH_W<'a, const O: u8> = crate::BitWriter<'a, u32, LIMITH_SPEC, LIMITH_A, O>;
impl<'a, const O: u8> LIMITH_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(LIMITH_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(LIMITH_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - Last results is equal or above CH\\[n\\].LIMIT.HIGH"]
#[inline(always)]
pub fn limith(&self) -> LIMITH_R {
LIMITH_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Last results is equal or above CH\\[n\\].LIMIT.HIGH"]
#[inline(always)]
pub fn limith(&mut self) -> LIMITH_W<0> {
LIMITH_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Description cluster: Last results is equal or above CH\\[n\\].LIMIT.HIGH\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [limith](index.html) module"]
pub struct LIMITH_SPEC;
impl crate::RegisterSpec for LIMITH_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [limith::R](R) reader structure"]
impl crate::Readable for LIMITH_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [limith::W](W) writer structure"]
impl crate::Writable for LIMITH_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets LIMITH to value 0"]
impl crate::Resettable for LIMITH_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+126
View File
@@ -0,0 +1,126 @@
#[doc = "Register `LIMITL` reader"]
pub struct R(crate::R<LIMITL_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<LIMITL_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<LIMITL_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<LIMITL_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `LIMITL` writer"]
pub struct W(crate::W<LIMITL_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<LIMITL_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<LIMITL_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<LIMITL_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `LIMITL` reader - Last results is equal or below CH\\[n\\].LIMIT.LOW"]
pub type LIMITL_R = crate::BitReader<LIMITL_A>;
#[doc = "Last results is equal or below CH\\[n\\].LIMIT.LOW\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LIMITL_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<LIMITL_A> for bool {
#[inline(always)]
fn from(variant: LIMITL_A) -> Self {
variant as u8 != 0
}
}
impl LIMITL_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> LIMITL_A {
match self.bits {
false => LIMITL_A::NOT_GENERATED,
true => LIMITL_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == LIMITL_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == LIMITL_A::GENERATED
}
}
#[doc = "Field `LIMITL` writer - Last results is equal or below CH\\[n\\].LIMIT.LOW"]
pub type LIMITL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LIMITL_SPEC, LIMITL_A, O>;
impl<'a, const O: u8> LIMITL_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(LIMITL_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(LIMITL_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - Last results is equal or below CH\\[n\\].LIMIT.LOW"]
#[inline(always)]
pub fn limitl(&self) -> LIMITL_R {
LIMITL_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Last results is equal or below CH\\[n\\].LIMIT.LOW"]
#[inline(always)]
pub fn limitl(&mut self) -> LIMITL_W<0> {
LIMITL_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Description cluster: Last results is equal or below CH\\[n\\].LIMIT.LOW\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [limitl](index.html) module"]
pub struct LIMITL_SPEC;
impl crate::RegisterSpec for LIMITL_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [limitl::R](R) reader structure"]
impl crate::Readable for LIMITL_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [limitl::W](W) writer structure"]
impl crate::Writable for LIMITL_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets LIMITL to value 0"]
impl crate::Resettable for LIMITL_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+127
View File
@@ -0,0 +1,127 @@
#[doc = "Register `EVENTS_DONE` reader"]
pub struct R(crate::R<EVENTS_DONE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_DONE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_DONE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_DONE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_DONE` writer"]
pub struct W(crate::W<EVENTS_DONE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_DONE_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_DONE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_DONE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EVENTS_DONE` reader - A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM."]
pub type EVENTS_DONE_R = crate::BitReader<EVENTS_DONE_A>;
#[doc = "A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EVENTS_DONE_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<EVENTS_DONE_A> for bool {
#[inline(always)]
fn from(variant: EVENTS_DONE_A) -> Self {
variant as u8 != 0
}
}
impl EVENTS_DONE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> EVENTS_DONE_A {
match self.bits {
false => EVENTS_DONE_A::NOT_GENERATED,
true => EVENTS_DONE_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == EVENTS_DONE_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == EVENTS_DONE_A::GENERATED
}
}
#[doc = "Field `EVENTS_DONE` writer - A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM."]
pub type EVENTS_DONE_W<'a, const O: u8> =
crate::BitWriter<'a, u32, EVENTS_DONE_SPEC, EVENTS_DONE_A, O>;
impl<'a, const O: u8> EVENTS_DONE_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(EVENTS_DONE_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(EVENTS_DONE_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM."]
#[inline(always)]
pub fn events_done(&self) -> EVENTS_DONE_R {
EVENTS_DONE_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM."]
#[inline(always)]
pub fn events_done(&mut self) -> EVENTS_DONE_W<0> {
EVENTS_DONE_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 = "A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_done](index.html) module"]
pub struct EVENTS_DONE_SPEC;
impl crate::RegisterSpec for EVENTS_DONE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_done::R](R) reader structure"]
impl crate::Readable for EVENTS_DONE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_done::W](W) writer structure"]
impl crate::Writable for EVENTS_DONE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_DONE to value 0"]
impl crate::Resettable for EVENTS_DONE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+127
View File
@@ -0,0 +1,127 @@
#[doc = "Register `EVENTS_END` reader"]
pub struct R(crate::R<EVENTS_END_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_END_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_END_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_END_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_END` writer"]
pub struct W(crate::W<EVENTS_END_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_END_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_END_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_END_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EVENTS_END` reader - The ADC has filled up the Result buffer"]
pub type EVENTS_END_R = crate::BitReader<EVENTS_END_A>;
#[doc = "The ADC has filled up the Result buffer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EVENTS_END_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<EVENTS_END_A> for bool {
#[inline(always)]
fn from(variant: EVENTS_END_A) -> Self {
variant as u8 != 0
}
}
impl EVENTS_END_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> EVENTS_END_A {
match self.bits {
false => EVENTS_END_A::NOT_GENERATED,
true => EVENTS_END_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == EVENTS_END_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == EVENTS_END_A::GENERATED
}
}
#[doc = "Field `EVENTS_END` writer - The ADC has filled up the Result buffer"]
pub type EVENTS_END_W<'a, const O: u8> =
crate::BitWriter<'a, u32, EVENTS_END_SPEC, EVENTS_END_A, O>;
impl<'a, const O: u8> EVENTS_END_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(EVENTS_END_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(EVENTS_END_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - The ADC has filled up the Result buffer"]
#[inline(always)]
pub fn events_end(&self) -> EVENTS_END_R {
EVENTS_END_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - The ADC has filled up the Result buffer"]
#[inline(always)]
pub fn events_end(&mut self) -> EVENTS_END_W<0> {
EVENTS_END_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 = "The ADC has filled up the Result buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_end](index.html) module"]
pub struct EVENTS_END_SPEC;
impl crate::RegisterSpec for EVENTS_END_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_end::R](R) reader structure"]
impl crate::Readable for EVENTS_END_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_end::W](W) writer structure"]
impl crate::Writable for EVENTS_END_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_END to value 0"]
impl crate::Resettable for EVENTS_END_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+127
View File
@@ -0,0 +1,127 @@
#[doc = "Register `EVENTS_RESULTDONE` reader"]
pub struct R(crate::R<EVENTS_RESULTDONE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_RESULTDONE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_RESULTDONE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_RESULTDONE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_RESULTDONE` writer"]
pub struct W(crate::W<EVENTS_RESULTDONE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_RESULTDONE_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_RESULTDONE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_RESULTDONE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EVENTS_RESULTDONE` reader - A result is ready to get transferred to RAM."]
pub type EVENTS_RESULTDONE_R = crate::BitReader<EVENTS_RESULTDONE_A>;
#[doc = "A result is ready to get transferred to RAM.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EVENTS_RESULTDONE_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<EVENTS_RESULTDONE_A> for bool {
#[inline(always)]
fn from(variant: EVENTS_RESULTDONE_A) -> Self {
variant as u8 != 0
}
}
impl EVENTS_RESULTDONE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> EVENTS_RESULTDONE_A {
match self.bits {
false => EVENTS_RESULTDONE_A::NOT_GENERATED,
true => EVENTS_RESULTDONE_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == EVENTS_RESULTDONE_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == EVENTS_RESULTDONE_A::GENERATED
}
}
#[doc = "Field `EVENTS_RESULTDONE` writer - A result is ready to get transferred to RAM."]
pub type EVENTS_RESULTDONE_W<'a, const O: u8> =
crate::BitWriter<'a, u32, EVENTS_RESULTDONE_SPEC, EVENTS_RESULTDONE_A, O>;
impl<'a, const O: u8> EVENTS_RESULTDONE_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(EVENTS_RESULTDONE_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(EVENTS_RESULTDONE_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - A result is ready to get transferred to RAM."]
#[inline(always)]
pub fn events_resultdone(&self) -> EVENTS_RESULTDONE_R {
EVENTS_RESULTDONE_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - A result is ready to get transferred to RAM."]
#[inline(always)]
pub fn events_resultdone(&mut self) -> EVENTS_RESULTDONE_W<0> {
EVENTS_RESULTDONE_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 = "A result is ready to get transferred to RAM.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_resultdone](index.html) module"]
pub struct EVENTS_RESULTDONE_SPEC;
impl crate::RegisterSpec for EVENTS_RESULTDONE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_resultdone::R](R) reader structure"]
impl crate::Readable for EVENTS_RESULTDONE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_resultdone::W](W) writer structure"]
impl crate::Writable for EVENTS_RESULTDONE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_RESULTDONE to value 0"]
impl crate::Resettable for EVENTS_RESULTDONE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+127
View File
@@ -0,0 +1,127 @@
#[doc = "Register `EVENTS_STARTED` reader"]
pub struct R(crate::R<EVENTS_STARTED_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_STARTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_STARTED_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_STARTED_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_STARTED` writer"]
pub struct W(crate::W<EVENTS_STARTED_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_STARTED_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_STARTED_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_STARTED_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EVENTS_STARTED` reader - The ADC has started"]
pub type EVENTS_STARTED_R = crate::BitReader<EVENTS_STARTED_A>;
#[doc = "The ADC has started\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EVENTS_STARTED_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<EVENTS_STARTED_A> for bool {
#[inline(always)]
fn from(variant: EVENTS_STARTED_A) -> Self {
variant as u8 != 0
}
}
impl EVENTS_STARTED_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> EVENTS_STARTED_A {
match self.bits {
false => EVENTS_STARTED_A::NOT_GENERATED,
true => EVENTS_STARTED_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == EVENTS_STARTED_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == EVENTS_STARTED_A::GENERATED
}
}
#[doc = "Field `EVENTS_STARTED` writer - The ADC has started"]
pub type EVENTS_STARTED_W<'a, const O: u8> =
crate::BitWriter<'a, u32, EVENTS_STARTED_SPEC, EVENTS_STARTED_A, O>;
impl<'a, const O: u8> EVENTS_STARTED_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(EVENTS_STARTED_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(EVENTS_STARTED_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - The ADC has started"]
#[inline(always)]
pub fn events_started(&self) -> EVENTS_STARTED_R {
EVENTS_STARTED_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - The ADC has started"]
#[inline(always)]
pub fn events_started(&mut self) -> EVENTS_STARTED_W<0> {
EVENTS_STARTED_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 = "The ADC has started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_started](index.html) module"]
pub struct EVENTS_STARTED_SPEC;
impl crate::RegisterSpec for EVENTS_STARTED_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_started::R](R) reader structure"]
impl crate::Readable for EVENTS_STARTED_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_started::W](W) writer structure"]
impl crate::Writable for EVENTS_STARTED_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_STARTED to value 0"]
impl crate::Resettable for EVENTS_STARTED_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+127
View File
@@ -0,0 +1,127 @@
#[doc = "Register `EVENTS_STOPPED` reader"]
pub struct R(crate::R<EVENTS_STOPPED_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_STOPPED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_STOPPED_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_STOPPED_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_STOPPED` writer"]
pub struct W(crate::W<EVENTS_STOPPED_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_STOPPED_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_STOPPED_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_STOPPED_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `EVENTS_STOPPED` reader - The ADC has stopped"]
pub type EVENTS_STOPPED_R = crate::BitReader<EVENTS_STOPPED_A>;
#[doc = "The ADC has stopped\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EVENTS_STOPPED_A {
#[doc = "0: Event not generated"]
NOT_GENERATED = 0,
#[doc = "1: Event generated"]
GENERATED = 1,
}
impl From<EVENTS_STOPPED_A> for bool {
#[inline(always)]
fn from(variant: EVENTS_STOPPED_A) -> Self {
variant as u8 != 0
}
}
impl EVENTS_STOPPED_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> EVENTS_STOPPED_A {
match self.bits {
false => EVENTS_STOPPED_A::NOT_GENERATED,
true => EVENTS_STOPPED_A::GENERATED,
}
}
#[doc = "Checks if the value of the field is `NOT_GENERATED`"]
#[inline(always)]
pub fn is_not_generated(&self) -> bool {
*self == EVENTS_STOPPED_A::NOT_GENERATED
}
#[doc = "Checks if the value of the field is `GENERATED`"]
#[inline(always)]
pub fn is_generated(&self) -> bool {
*self == EVENTS_STOPPED_A::GENERATED
}
}
#[doc = "Field `EVENTS_STOPPED` writer - The ADC has stopped"]
pub type EVENTS_STOPPED_W<'a, const O: u8> =
crate::BitWriter<'a, u32, EVENTS_STOPPED_SPEC, EVENTS_STOPPED_A, O>;
impl<'a, const O: u8> EVENTS_STOPPED_W<'a, O> {
#[doc = "Event not generated"]
#[inline(always)]
pub fn not_generated(self) -> &'a mut W {
self.variant(EVENTS_STOPPED_A::NOT_GENERATED)
}
#[doc = "Event generated"]
#[inline(always)]
pub fn generated(self) -> &'a mut W {
self.variant(EVENTS_STOPPED_A::GENERATED)
}
}
impl R {
#[doc = "Bit 0 - The ADC has stopped"]
#[inline(always)]
pub fn events_stopped(&self) -> EVENTS_STOPPED_R {
EVENTS_STOPPED_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - The ADC has stopped"]
#[inline(always)]
pub fn events_stopped(&mut self) -> EVENTS_STOPPED_W<0> {
EVENTS_STOPPED_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 = "The ADC has stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"]
pub struct EVENTS_STOPPED_SPEC;
impl crate::RegisterSpec for EVENTS_STOPPED_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_stopped::R](R) reader structure"]
impl crate::Readable for EVENTS_STOPPED_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"]
impl crate::Writable for EVENTS_STOPPED_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"]
impl crate::Resettable for EVENTS_STOPPED_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+220
View File
@@ -0,0 +1,220 @@
#[doc = "Register `OVERSAMPLE` reader"]
pub struct R(crate::R<OVERSAMPLE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<OVERSAMPLE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<OVERSAMPLE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<OVERSAMPLE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `OVERSAMPLE` writer"]
pub struct W(crate::W<OVERSAMPLE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<OVERSAMPLE_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<OVERSAMPLE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<OVERSAMPLE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `OVERSAMPLE` reader - Oversample control"]
pub type OVERSAMPLE_R = crate::FieldReader<u8, OVERSAMPLE_A>;
#[doc = "Oversample control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OVERSAMPLE_A {
#[doc = "0: Bypass oversampling"]
BYPASS = 0,
#[doc = "1: Oversample 2x"]
OVER2X = 1,
#[doc = "2: Oversample 4x"]
OVER4X = 2,
#[doc = "3: Oversample 8x"]
OVER8X = 3,
#[doc = "4: Oversample 16x"]
OVER16X = 4,
#[doc = "5: Oversample 32x"]
OVER32X = 5,
#[doc = "6: Oversample 64x"]
OVER64X = 6,
#[doc = "7: Oversample 128x"]
OVER128X = 7,
#[doc = "8: Oversample 256x"]
OVER256X = 8,
}
impl From<OVERSAMPLE_A> for u8 {
#[inline(always)]
fn from(variant: OVERSAMPLE_A) -> Self {
variant as _
}
}
impl OVERSAMPLE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<OVERSAMPLE_A> {
match self.bits {
0 => Some(OVERSAMPLE_A::BYPASS),
1 => Some(OVERSAMPLE_A::OVER2X),
2 => Some(OVERSAMPLE_A::OVER4X),
3 => Some(OVERSAMPLE_A::OVER8X),
4 => Some(OVERSAMPLE_A::OVER16X),
5 => Some(OVERSAMPLE_A::OVER32X),
6 => Some(OVERSAMPLE_A::OVER64X),
7 => Some(OVERSAMPLE_A::OVER128X),
8 => Some(OVERSAMPLE_A::OVER256X),
_ => None,
}
}
#[doc = "Checks if the value of the field is `BYPASS`"]
#[inline(always)]
pub fn is_bypass(&self) -> bool {
*self == OVERSAMPLE_A::BYPASS
}
#[doc = "Checks if the value of the field is `OVER2X`"]
#[inline(always)]
pub fn is_over2x(&self) -> bool {
*self == OVERSAMPLE_A::OVER2X
}
#[doc = "Checks if the value of the field is `OVER4X`"]
#[inline(always)]
pub fn is_over4x(&self) -> bool {
*self == OVERSAMPLE_A::OVER4X
}
#[doc = "Checks if the value of the field is `OVER8X`"]
#[inline(always)]
pub fn is_over8x(&self) -> bool {
*self == OVERSAMPLE_A::OVER8X
}
#[doc = "Checks if the value of the field is `OVER16X`"]
#[inline(always)]
pub fn is_over16x(&self) -> bool {
*self == OVERSAMPLE_A::OVER16X
}
#[doc = "Checks if the value of the field is `OVER32X`"]
#[inline(always)]
pub fn is_over32x(&self) -> bool {
*self == OVERSAMPLE_A::OVER32X
}
#[doc = "Checks if the value of the field is `OVER64X`"]
#[inline(always)]
pub fn is_over64x(&self) -> bool {
*self == OVERSAMPLE_A::OVER64X
}
#[doc = "Checks if the value of the field is `OVER128X`"]
#[inline(always)]
pub fn is_over128x(&self) -> bool {
*self == OVERSAMPLE_A::OVER128X
}
#[doc = "Checks if the value of the field is `OVER256X`"]
#[inline(always)]
pub fn is_over256x(&self) -> bool {
*self == OVERSAMPLE_A::OVER256X
}
}
#[doc = "Field `OVERSAMPLE` writer - Oversample control"]
pub type OVERSAMPLE_W<'a, const O: u8> =
crate::FieldWriter<'a, u32, OVERSAMPLE_SPEC, u8, OVERSAMPLE_A, 4, O>;
impl<'a, const O: u8> OVERSAMPLE_W<'a, O> {
#[doc = "Bypass oversampling"]
#[inline(always)]
pub fn bypass(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::BYPASS)
}
#[doc = "Oversample 2x"]
#[inline(always)]
pub fn over2x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER2X)
}
#[doc = "Oversample 4x"]
#[inline(always)]
pub fn over4x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER4X)
}
#[doc = "Oversample 8x"]
#[inline(always)]
pub fn over8x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER8X)
}
#[doc = "Oversample 16x"]
#[inline(always)]
pub fn over16x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER16X)
}
#[doc = "Oversample 32x"]
#[inline(always)]
pub fn over32x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER32X)
}
#[doc = "Oversample 64x"]
#[inline(always)]
pub fn over64x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER64X)
}
#[doc = "Oversample 128x"]
#[inline(always)]
pub fn over128x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER128X)
}
#[doc = "Oversample 256x"]
#[inline(always)]
pub fn over256x(self) -> &'a mut W {
self.variant(OVERSAMPLE_A::OVER256X)
}
}
impl R {
#[doc = "Bits 0:3 - Oversample control"]
#[inline(always)]
pub fn oversample(&self) -> OVERSAMPLE_R {
OVERSAMPLE_R::new((self.bits & 0x0f) as u8)
}
}
impl W {
#[doc = "Bits 0:3 - Oversample control"]
#[inline(always)]
pub fn oversample(&mut self) -> OVERSAMPLE_W<0> {
OVERSAMPLE_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 = "Oversampling configuration. OVERSAMPLE should not be combined with SCAN. The RESOLUTION is applied before averaging, thus for high OVERSAMPLE a higher RESOLUTION should be used.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [oversample](index.html) module"]
pub struct OVERSAMPLE_SPEC;
impl crate::RegisterSpec for OVERSAMPLE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [oversample::R](R) reader structure"]
impl crate::Readable for OVERSAMPLE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [oversample::W](W) writer structure"]
impl crate::Writable for OVERSAMPLE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets OVERSAMPLE to value 0"]
impl crate::Resettable for OVERSAMPLE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+154
View File
@@ -0,0 +1,154 @@
#[doc = "Register `RESOLUTION` reader"]
pub struct R(crate::R<RESOLUTION_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<RESOLUTION_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<RESOLUTION_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<RESOLUTION_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `RESOLUTION` writer"]
pub struct W(crate::W<RESOLUTION_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<RESOLUTION_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<RESOLUTION_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<RESOLUTION_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `VAL` reader - Set the resolution"]
pub type VAL_R = crate::FieldReader<u8, VAL_A>;
#[doc = "Set the resolution\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum VAL_A {
#[doc = "0: 8 bit"]
_8BIT = 0,
#[doc = "1: 10 bit"]
_10BIT = 1,
#[doc = "2: 12 bit"]
_12BIT = 2,
#[doc = "3: 14 bit"]
_14BIT = 3,
}
impl From<VAL_A> for u8 {
#[inline(always)]
fn from(variant: VAL_A) -> Self {
variant as _
}
}
impl VAL_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<VAL_A> {
match self.bits {
0 => Some(VAL_A::_8BIT),
1 => Some(VAL_A::_10BIT),
2 => Some(VAL_A::_12BIT),
3 => Some(VAL_A::_14BIT),
_ => None,
}
}
#[doc = "Checks if the value of the field is `_8BIT`"]
#[inline(always)]
pub fn is_8bit(&self) -> bool {
*self == VAL_A::_8BIT
}
#[doc = "Checks if the value of the field is `_10BIT`"]
#[inline(always)]
pub fn is_10bit(&self) -> bool {
*self == VAL_A::_10BIT
}
#[doc = "Checks if the value of the field is `_12BIT`"]
#[inline(always)]
pub fn is_12bit(&self) -> bool {
*self == VAL_A::_12BIT
}
#[doc = "Checks if the value of the field is `_14BIT`"]
#[inline(always)]
pub fn is_14bit(&self) -> bool {
*self == VAL_A::_14BIT
}
}
#[doc = "Field `VAL` writer - Set the resolution"]
pub type VAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RESOLUTION_SPEC, u8, VAL_A, 3, O>;
impl<'a, const O: u8> VAL_W<'a, O> {
#[doc = "8 bit"]
#[inline(always)]
pub fn _8bit(self) -> &'a mut W {
self.variant(VAL_A::_8BIT)
}
#[doc = "10 bit"]
#[inline(always)]
pub fn _10bit(self) -> &'a mut W {
self.variant(VAL_A::_10BIT)
}
#[doc = "12 bit"]
#[inline(always)]
pub fn _12bit(self) -> &'a mut W {
self.variant(VAL_A::_12BIT)
}
#[doc = "14 bit"]
#[inline(always)]
pub fn _14bit(self) -> &'a mut W {
self.variant(VAL_A::_14BIT)
}
}
impl R {
#[doc = "Bits 0:2 - Set the resolution"]
#[inline(always)]
pub fn val(&self) -> VAL_R {
VAL_R::new((self.bits & 7) as u8)
}
}
impl W {
#[doc = "Bits 0:2 - Set the resolution"]
#[inline(always)]
pub fn val(&mut self) -> VAL_W<0> {
VAL_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 = "Resolution configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resolution](index.html) module"]
pub struct RESOLUTION_SPEC;
impl crate::RegisterSpec for RESOLUTION_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [resolution::R](R) reader structure"]
impl crate::Readable for RESOLUTION_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [resolution::W](W) writer structure"]
impl crate::Writable for RESOLUTION_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets RESOLUTION to value 0x01"]
impl crate::Resettable for RESOLUTION_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x01
}
}
+22
View File
@@ -0,0 +1,22 @@
#[doc = r"Register block"]
#[repr(C)]
pub struct RESULT {
#[doc = "0x00 - Data pointer"]
pub ptr: PTR,
#[doc = "0x04 - Maximum number of buffer words to transfer"]
pub maxcnt: MAXCNT,
#[doc = "0x08 - Number of buffer words transferred since last START"]
pub amount: AMOUNT,
}
#[doc = "PTR (rw) register accessor: an alias for `Reg<PTR_SPEC>`"]
pub type PTR = crate::Reg<ptr::PTR_SPEC>;
#[doc = "Data pointer"]
pub mod ptr;
#[doc = "MAXCNT (rw) register accessor: an alias for `Reg<MAXCNT_SPEC>`"]
pub type MAXCNT = crate::Reg<maxcnt::MAXCNT_SPEC>;
#[doc = "Maximum number of buffer words to transfer"]
pub mod maxcnt;
#[doc = "AMOUNT (r) register accessor: an alias for `Reg<AMOUNT_SPEC>`"]
pub type AMOUNT = crate::Reg<amount::AMOUNT_SPEC>;
#[doc = "Number of buffer words transferred since last START"]
pub mod amount;
+40
View File
@@ -0,0 +1,40 @@
#[doc = "Register `AMOUNT` reader"]
pub struct R(crate::R<AMOUNT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<AMOUNT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<AMOUNT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<AMOUNT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `AMOUNT` reader - Number of buffer words transferred since last START. This register can be read after an END or STOPPED event."]
pub type AMOUNT_R = crate::FieldReader<u16, u16>;
impl R {
#[doc = "Bits 0:14 - Number of buffer words transferred since last START. This register can be read after an END or STOPPED event."]
#[inline(always)]
pub fn amount(&self) -> AMOUNT_R {
AMOUNT_R::new((self.bits & 0x7fff) as u16)
}
}
#[doc = "Number of buffer words transferred since last START\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [amount](index.html) module"]
pub struct AMOUNT_SPEC;
impl crate::RegisterSpec for AMOUNT_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [amount::R](R) reader structure"]
impl crate::Readable for AMOUNT_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets AMOUNT to value 0"]
impl crate::Resettable for AMOUNT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+80
View File
@@ -0,0 +1,80 @@
#[doc = "Register `MAXCNT` reader"]
pub struct R(crate::R<MAXCNT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<MAXCNT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<MAXCNT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<MAXCNT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `MAXCNT` writer"]
pub struct W(crate::W<MAXCNT_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<MAXCNT_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<MAXCNT_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<MAXCNT_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `MAXCNT` reader - Maximum number of buffer words to transfer"]
pub type MAXCNT_R = crate::FieldReader<u16, u16>;
#[doc = "Field `MAXCNT` writer - Maximum number of buffer words to transfer"]
pub type MAXCNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAXCNT_SPEC, u16, u16, 15, O>;
impl R {
#[doc = "Bits 0:14 - Maximum number of buffer words to transfer"]
#[inline(always)]
pub fn maxcnt(&self) -> MAXCNT_R {
MAXCNT_R::new((self.bits & 0x7fff) as u16)
}
}
impl W {
#[doc = "Bits 0:14 - Maximum number of buffer words to transfer"]
#[inline(always)]
pub fn maxcnt(&mut self) -> MAXCNT_W<0> {
MAXCNT_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 = "Maximum number of buffer words to transfer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"]
pub struct MAXCNT_SPEC;
impl crate::RegisterSpec for MAXCNT_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [maxcnt::R](R) reader structure"]
impl crate::Readable for MAXCNT_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"]
impl crate::Writable for MAXCNT_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets MAXCNT to value 0"]
impl crate::Resettable for MAXCNT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+80
View File
@@ -0,0 +1,80 @@
#[doc = "Register `PTR` reader"]
pub struct R(crate::R<PTR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PTR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PTR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PTR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PTR` writer"]
pub struct W(crate::W<PTR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PTR_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<PTR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PTR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `PTR` reader - Data pointer"]
pub type PTR_R = crate::FieldReader<u32, u32>;
#[doc = "Field `PTR` writer - Data pointer"]
pub type PTR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PTR_SPEC, u32, u32, 32, O>;
impl R {
#[doc = "Bits 0:31 - Data pointer"]
#[inline(always)]
pub fn ptr(&self) -> PTR_R {
PTR_R::new(self.bits)
}
}
impl W {
#[doc = "Bits 0:31 - Data pointer"]
#[inline(always)]
pub fn ptr(&mut self) -> PTR_W<0> {
PTR_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 = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"]
pub struct PTR_SPEC;
impl crate::RegisterSpec for PTR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ptr::R](R) reader structure"]
impl crate::Readable for PTR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"]
impl crate::Writable for PTR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PTR to value 0"]
impl crate::Resettable for PTR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+140
View File
@@ -0,0 +1,140 @@
#[doc = "Register `SAMPLERATE` reader"]
pub struct R(crate::R<SAMPLERATE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SAMPLERATE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SAMPLERATE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SAMPLERATE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SAMPLERATE` writer"]
pub struct W(crate::W<SAMPLERATE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SAMPLERATE_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<SAMPLERATE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SAMPLERATE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `CC` reader - Capture and compare value. Sample rate is 16 MHz/CC"]
pub type CC_R = crate::FieldReader<u16, u16>;
#[doc = "Field `CC` writer - Capture and compare value. Sample rate is 16 MHz/CC"]
pub type CC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SAMPLERATE_SPEC, u16, u16, 11, O>;
#[doc = "Field `MODE` reader - Select mode for sample rate control"]
pub type MODE_R = crate::BitReader<MODE_A>;
#[doc = "Select mode for sample rate control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MODE_A {
#[doc = "0: Rate is controlled from SAMPLE task"]
TASK = 0,
#[doc = "1: Rate is controlled from local timer (use CC to control the rate)"]
TIMERS = 1,
}
impl From<MODE_A> for bool {
#[inline(always)]
fn from(variant: MODE_A) -> Self {
variant as u8 != 0
}
}
impl MODE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> MODE_A {
match self.bits {
false => MODE_A::TASK,
true => MODE_A::TIMERS,
}
}
#[doc = "Checks if the value of the field is `TASK`"]
#[inline(always)]
pub fn is_task(&self) -> bool {
*self == MODE_A::TASK
}
#[doc = "Checks if the value of the field is `TIMERS`"]
#[inline(always)]
pub fn is_timers(&self) -> bool {
*self == MODE_A::TIMERS
}
}
#[doc = "Field `MODE` writer - Select mode for sample rate control"]
pub type MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SAMPLERATE_SPEC, MODE_A, O>;
impl<'a, const O: u8> MODE_W<'a, O> {
#[doc = "Rate is controlled from SAMPLE task"]
#[inline(always)]
pub fn task(self) -> &'a mut W {
self.variant(MODE_A::TASK)
}
#[doc = "Rate is controlled from local timer (use CC to control the rate)"]
#[inline(always)]
pub fn timers(self) -> &'a mut W {
self.variant(MODE_A::TIMERS)
}
}
impl R {
#[doc = "Bits 0:10 - Capture and compare value. Sample rate is 16 MHz/CC"]
#[inline(always)]
pub fn cc(&self) -> CC_R {
CC_R::new((self.bits & 0x07ff) as u16)
}
#[doc = "Bit 12 - Select mode for sample rate control"]
#[inline(always)]
pub fn mode(&self) -> MODE_R {
MODE_R::new(((self.bits >> 12) & 1) != 0)
}
}
impl W {
#[doc = "Bits 0:10 - Capture and compare value. Sample rate is 16 MHz/CC"]
#[inline(always)]
pub fn cc(&mut self) -> CC_W<0> {
CC_W::new(self)
}
#[doc = "Bit 12 - Select mode for sample rate control"]
#[inline(always)]
pub fn mode(&mut self) -> MODE_W<12> {
MODE_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 = "Controls normal or continuous sample rate\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [samplerate](index.html) module"]
pub struct SAMPLERATE_SPEC;
impl crate::RegisterSpec for SAMPLERATE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [samplerate::R](R) reader structure"]
impl crate::Readable for SAMPLERATE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [samplerate::W](W) writer structure"]
impl crate::Writable for SAMPLERATE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SAMPLERATE to value 0"]
impl crate::Resettable for SAMPLERATE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+74
View File
@@ -0,0 +1,74 @@
#[doc = "Register `STATUS` reader"]
pub struct R(crate::R<STATUS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<STATUS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<STATUS_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<STATUS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `STATUS` reader - Status"]
pub type STATUS_R = crate::BitReader<STATUS_A>;
#[doc = "Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STATUS_A {
#[doc = "0: ADC is ready. No on-going conversion."]
READY = 0,
#[doc = "1: ADC is busy. Conversion in progress."]
BUSY = 1,
}
impl From<STATUS_A> for bool {
#[inline(always)]
fn from(variant: STATUS_A) -> Self {
variant as u8 != 0
}
}
impl STATUS_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> STATUS_A {
match self.bits {
false => STATUS_A::READY,
true => STATUS_A::BUSY,
}
}
#[doc = "Checks if the value of the field is `READY`"]
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == STATUS_A::READY
}
#[doc = "Checks if the value of the field is `BUSY`"]
#[inline(always)]
pub fn is_busy(&self) -> bool {
*self == STATUS_A::BUSY
}
}
impl R {
#[doc = "Bit 0 - Status"]
#[inline(always)]
pub fn status(&self) -> STATUS_R {
STATUS_R::new((self.bits & 1) != 0)
}
}
#[doc = "Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [status](index.html) module"]
pub struct STATUS_SPEC;
impl crate::RegisterSpec for STATUS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [status::R](R) reader structure"]
impl crate::Readable for STATUS_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets STATUS to value 0"]
impl crate::Resettable for STATUS_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+72
View File
@@ -0,0 +1,72 @@
#[doc = "Register `TASKS_CALIBRATEOFFSET` writer"]
pub struct W(crate::W<TASKS_CALIBRATEOFFSET_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_CALIBRATEOFFSET_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_CALIBRATEOFFSET_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_CALIBRATEOFFSET_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Starts offset auto-calibration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TASKS_CALIBRATEOFFSET_AW {
#[doc = "1: Trigger task"]
TRIGGER = 1,
}
impl From<TASKS_CALIBRATEOFFSET_AW> for bool {
#[inline(always)]
fn from(variant: TASKS_CALIBRATEOFFSET_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `TASKS_CALIBRATEOFFSET` writer - Starts offset auto-calibration"]
pub type TASKS_CALIBRATEOFFSET_W<'a, const O: u8> =
crate::BitWriter<'a, u32, TASKS_CALIBRATEOFFSET_SPEC, TASKS_CALIBRATEOFFSET_AW, O>;
impl<'a, const O: u8> TASKS_CALIBRATEOFFSET_W<'a, O> {
#[doc = "Trigger task"]
#[inline(always)]
pub fn trigger(self) -> &'a mut W {
self.variant(TASKS_CALIBRATEOFFSET_AW::TRIGGER)
}
}
impl W {
#[doc = "Bit 0 - Starts offset auto-calibration"]
#[inline(always)]
pub fn tasks_calibrateoffset(&mut self) -> TASKS_CALIBRATEOFFSET_W<0> {
TASKS_CALIBRATEOFFSET_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 = "Starts offset auto-calibration\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_calibrateoffset](index.html) module"]
pub struct TASKS_CALIBRATEOFFSET_SPEC;
impl crate::RegisterSpec for TASKS_CALIBRATEOFFSET_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_calibrateoffset::W](W) writer structure"]
impl crate::Writable for TASKS_CALIBRATEOFFSET_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_CALIBRATEOFFSET to value 0"]
impl crate::Resettable for TASKS_CALIBRATEOFFSET_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+72
View File
@@ -0,0 +1,72 @@
#[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 = "Take one ADC sample, if scan is enabled all channels are sampled\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TASKS_SAMPLE_AW {
#[doc = "1: Trigger task"]
TRIGGER = 1,
}
impl From<TASKS_SAMPLE_AW> for bool {
#[inline(always)]
fn from(variant: TASKS_SAMPLE_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `TASKS_SAMPLE` writer - Take one ADC sample, if scan is enabled all channels are sampled"]
pub type TASKS_SAMPLE_W<'a, const O: u8> =
crate::BitWriter<'a, u32, TASKS_SAMPLE_SPEC, TASKS_SAMPLE_AW, O>;
impl<'a, const O: u8> TASKS_SAMPLE_W<'a, O> {
#[doc = "Trigger task"]
#[inline(always)]
pub fn trigger(self) -> &'a mut W {
self.variant(TASKS_SAMPLE_AW::TRIGGER)
}
}
impl W {
#[doc = "Bit 0 - Take one ADC sample, if scan is enabled all channels are sampled"]
#[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 = "Take one ADC sample, if scan is enabled all channels are sampled\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_sample](index.html) module"]
pub struct TASKS_SAMPLE_SPEC;
impl crate::RegisterSpec for TASKS_SAMPLE_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_sample::W](W) writer structure"]
impl crate::Writable for TASKS_SAMPLE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_SAMPLE to value 0"]
impl crate::Resettable for TASKS_SAMPLE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+72
View File
@@ -0,0 +1,72 @@
#[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 = "Start the ADC and prepare the result buffer in RAM\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TASKS_START_AW {
#[doc = "1: Trigger task"]
TRIGGER = 1,
}
impl From<TASKS_START_AW> for bool {
#[inline(always)]
fn from(variant: TASKS_START_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `TASKS_START` writer - Start the ADC and prepare the result buffer in RAM"]
pub type TASKS_START_W<'a, const O: u8> =
crate::BitWriter<'a, u32, TASKS_START_SPEC, TASKS_START_AW, O>;
impl<'a, const O: u8> TASKS_START_W<'a, O> {
#[doc = "Trigger task"]
#[inline(always)]
pub fn trigger(self) -> &'a mut W {
self.variant(TASKS_START_AW::TRIGGER)
}
}
impl W {
#[doc = "Bit 0 - Start the ADC and prepare the result buffer in RAM"]
#[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 the ADC and prepare the result buffer in RAM\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"]
pub struct TASKS_START_SPEC;
impl crate::RegisterSpec for TASKS_START_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"]
impl crate::Writable for TASKS_START_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_START to value 0"]
impl crate::Resettable for TASKS_START_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+72
View File
@@ -0,0 +1,72 @@
#[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 = "Stop the ADC and terminate any on-going conversion\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TASKS_STOP_AW {
#[doc = "1: Trigger task"]
TRIGGER = 1,
}
impl From<TASKS_STOP_AW> for bool {
#[inline(always)]
fn from(variant: TASKS_STOP_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `TASKS_STOP` writer - Stop the ADC and terminate any on-going conversion"]
pub type TASKS_STOP_W<'a, const O: u8> =
crate::BitWriter<'a, u32, TASKS_STOP_SPEC, TASKS_STOP_AW, O>;
impl<'a, const O: u8> TASKS_STOP_W<'a, O> {
#[doc = "Trigger task"]
#[inline(always)]
pub fn trigger(self) -> &'a mut W {
self.variant(TASKS_STOP_AW::TRIGGER)
}
}
impl W {
#[doc = "Bit 0 - Stop the ADC and terminate any on-going conversion"]
#[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 the ADC and terminate any on-going conversion\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"]
pub struct TASKS_STOP_SPEC;
impl crate::RegisterSpec for TASKS_STOP_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"]
impl crate::Writable for TASKS_STOP_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_STOP to value 0"]
impl crate::Resettable for TASKS_STOP_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}