pub type R = crate::R<CR1rs>;
pub type W = crate::W<CR1rs>;
pub type AWDCH_R = crate::FieldReader;
pub type AWDCH_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EOCIE {
Disabled = 0,
Enabled = 1,
}
impl From<EOCIE> for bool {
#[inline(always)]
fn from(variant: EOCIE) -> Self {
variant as u8 != 0
}
}
pub type EOCIE_R = crate::BitReader<EOCIE>;
impl EOCIE_R {
#[inline(always)]
pub const fn variant(&self) -> EOCIE {
match self.bits {
false => EOCIE::Disabled,
true => EOCIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EOCIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == EOCIE::Enabled
}
}
pub type EOCIE_W<'a, REG> = crate::BitWriter<'a, REG, EOCIE>;
impl<'a, REG> EOCIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(EOCIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(EOCIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWDIE {
Disabled = 0,
Enabled = 1,
}
impl From<AWDIE> for bool {
#[inline(always)]
fn from(variant: AWDIE) -> Self {
variant as u8 != 0
}
}
pub type AWDIE_R = crate::BitReader<AWDIE>;
impl AWDIE_R {
#[inline(always)]
pub const fn variant(&self) -> AWDIE {
match self.bits {
false => AWDIE::Disabled,
true => AWDIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == AWDIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == AWDIE::Enabled
}
}
pub type AWDIE_W<'a, REG> = crate::BitWriter<'a, REG, AWDIE>;
impl<'a, REG> AWDIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JEOCIE {
Disabled = 0,
Enabled = 1,
}
impl From<JEOCIE> for bool {
#[inline(always)]
fn from(variant: JEOCIE) -> Self {
variant as u8 != 0
}
}
pub type JEOCIE_R = crate::BitReader<JEOCIE>;
impl JEOCIE_R {
#[inline(always)]
pub const fn variant(&self) -> JEOCIE {
match self.bits {
false => JEOCIE::Disabled,
true => JEOCIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JEOCIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JEOCIE::Enabled
}
}
pub type JEOCIE_W<'a, REG> = crate::BitWriter<'a, REG, JEOCIE>;
impl<'a, REG> JEOCIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JEOCIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JEOCIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SCAN {
Disabled = 0,
Enabled = 1,
}
impl From<SCAN> for bool {
#[inline(always)]
fn from(variant: SCAN) -> Self {
variant as u8 != 0
}
}
pub type SCAN_R = crate::BitReader<SCAN>;
impl SCAN_R {
#[inline(always)]
pub const fn variant(&self) -> SCAN {
match self.bits {
false => SCAN::Disabled,
true => SCAN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SCAN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SCAN::Enabled
}
}
pub type SCAN_W<'a, REG> = crate::BitWriter<'a, REG, SCAN>;
impl<'a, REG> SCAN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SCAN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SCAN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWDSGL {
All = 0,
Single = 1,
}
impl From<AWDSGL> for bool {
#[inline(always)]
fn from(variant: AWDSGL) -> Self {
variant as u8 != 0
}
}
pub type AWDSGL_R = crate::BitReader<AWDSGL>;
impl AWDSGL_R {
#[inline(always)]
pub const fn variant(&self) -> AWDSGL {
match self.bits {
false => AWDSGL::All,
true => AWDSGL::Single,
}
}
#[inline(always)]
pub fn is_all(&self) -> bool {
*self == AWDSGL::All
}
#[inline(always)]
pub fn is_single(&self) -> bool {
*self == AWDSGL::Single
}
}
pub type AWDSGL_W<'a, REG> = crate::BitWriter<'a, REG, AWDSGL>;
impl<'a, REG> AWDSGL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn all(self) -> &'a mut crate::W<REG> {
self.variant(AWDSGL::All)
}
#[inline(always)]
pub fn single(self) -> &'a mut crate::W<REG> {
self.variant(AWDSGL::Single)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JAUTO {
Disabled = 0,
Enabled = 1,
}
impl From<JAUTO> for bool {
#[inline(always)]
fn from(variant: JAUTO) -> Self {
variant as u8 != 0
}
}
pub type JAUTO_R = crate::BitReader<JAUTO>;
impl JAUTO_R {
#[inline(always)]
pub const fn variant(&self) -> JAUTO {
match self.bits {
false => JAUTO::Disabled,
true => JAUTO::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JAUTO::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JAUTO::Enabled
}
}
pub type JAUTO_W<'a, REG> = crate::BitWriter<'a, REG, JAUTO>;
impl<'a, REG> JAUTO_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JAUTO::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JAUTO::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DISCEN {
Disabled = 0,
Enabled = 1,
}
impl From<DISCEN> for bool {
#[inline(always)]
fn from(variant: DISCEN) -> Self {
variant as u8 != 0
}
}
pub type DISCEN_R = crate::BitReader<DISCEN>;
impl DISCEN_R {
#[inline(always)]
pub const fn variant(&self) -> DISCEN {
match self.bits {
false => DISCEN::Disabled,
true => DISCEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DISCEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DISCEN::Enabled
}
}
pub type DISCEN_W<'a, REG> = crate::BitWriter<'a, REG, DISCEN>;
impl<'a, REG> DISCEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DISCEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DISCEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JDISCEN {
Disabled = 0,
Enabled = 1,
}
impl From<JDISCEN> for bool {
#[inline(always)]
fn from(variant: JDISCEN) -> Self {
variant as u8 != 0
}
}
pub type JDISCEN_R = crate::BitReader<JDISCEN>;
impl JDISCEN_R {
#[inline(always)]
pub const fn variant(&self) -> JDISCEN {
match self.bits {
false => JDISCEN::Disabled,
true => JDISCEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JDISCEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JDISCEN::Enabled
}
}
pub type JDISCEN_W<'a, REG> = crate::BitWriter<'a, REG, JDISCEN>;
impl<'a, REG> JDISCEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JDISCEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JDISCEN::Enabled)
}
}
pub type DISCNUM_R = crate::FieldReader;
pub type DISCNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 3, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DUALMOD {
Independent = 0,
RegularInjected = 1,
RegularAlternateTrigger = 2,
InjectedFastInterleaved = 3,
InjectedSlowInterleaved = 4,
Injected = 5,
Regular = 6,
FastInterleaved = 7,
SlowInterleaved = 8,
AlternateTrigger = 9,
}
impl From<DUALMOD> for u8 {
#[inline(always)]
fn from(variant: DUALMOD) -> Self {
variant as _
}
}
impl crate::FieldSpec for DUALMOD {
type Ux = u8;
}
impl crate::IsEnum for DUALMOD {}
pub type DUALMOD_R = crate::FieldReader<DUALMOD>;
impl DUALMOD_R {
#[inline(always)]
pub const fn variant(&self) -> Option<DUALMOD> {
match self.bits {
0 => Some(DUALMOD::Independent),
1 => Some(DUALMOD::RegularInjected),
2 => Some(DUALMOD::RegularAlternateTrigger),
3 => Some(DUALMOD::InjectedFastInterleaved),
4 => Some(DUALMOD::InjectedSlowInterleaved),
5 => Some(DUALMOD::Injected),
6 => Some(DUALMOD::Regular),
7 => Some(DUALMOD::FastInterleaved),
8 => Some(DUALMOD::SlowInterleaved),
9 => Some(DUALMOD::AlternateTrigger),
_ => None,
}
}
#[inline(always)]
pub fn is_independent(&self) -> bool {
*self == DUALMOD::Independent
}
#[inline(always)]
pub fn is_regular_injected(&self) -> bool {
*self == DUALMOD::RegularInjected
}
#[inline(always)]
pub fn is_regular_alternate_trigger(&self) -> bool {
*self == DUALMOD::RegularAlternateTrigger
}
#[inline(always)]
pub fn is_injected_fast_interleaved(&self) -> bool {
*self == DUALMOD::InjectedFastInterleaved
}
#[inline(always)]
pub fn is_injected_slow_interleaved(&self) -> bool {
*self == DUALMOD::InjectedSlowInterleaved
}
#[inline(always)]
pub fn is_injected(&self) -> bool {
*self == DUALMOD::Injected
}
#[inline(always)]
pub fn is_regular(&self) -> bool {
*self == DUALMOD::Regular
}
#[inline(always)]
pub fn is_fast_interleaved(&self) -> bool {
*self == DUALMOD::FastInterleaved
}
#[inline(always)]
pub fn is_slow_interleaved(&self) -> bool {
*self == DUALMOD::SlowInterleaved
}
#[inline(always)]
pub fn is_alternate_trigger(&self) -> bool {
*self == DUALMOD::AlternateTrigger
}
}
pub type DUALMOD_W<'a, REG> = crate::FieldWriter<'a, REG, 4, DUALMOD>;
impl<'a, REG> DUALMOD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn independent(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::Independent)
}
#[inline(always)]
pub fn regular_injected(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::RegularInjected)
}
#[inline(always)]
pub fn regular_alternate_trigger(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::RegularAlternateTrigger)
}
#[inline(always)]
pub fn injected_fast_interleaved(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::InjectedFastInterleaved)
}
#[inline(always)]
pub fn injected_slow_interleaved(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::InjectedSlowInterleaved)
}
#[inline(always)]
pub fn injected(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::Injected)
}
#[inline(always)]
pub fn regular(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::Regular)
}
#[inline(always)]
pub fn fast_interleaved(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::FastInterleaved)
}
#[inline(always)]
pub fn slow_interleaved(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::SlowInterleaved)
}
#[inline(always)]
pub fn alternate_trigger(self) -> &'a mut crate::W<REG> {
self.variant(DUALMOD::AlternateTrigger)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JAWDEN {
Disabled = 0,
Enabled = 1,
}
impl From<JAWDEN> for bool {
#[inline(always)]
fn from(variant: JAWDEN) -> Self {
variant as u8 != 0
}
}
pub type JAWDEN_R = crate::BitReader<JAWDEN>;
impl JAWDEN_R {
#[inline(always)]
pub const fn variant(&self) -> JAWDEN {
match self.bits {
false => JAWDEN::Disabled,
true => JAWDEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JAWDEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JAWDEN::Enabled
}
}
pub type JAWDEN_W<'a, REG> = crate::BitWriter<'a, REG, JAWDEN>;
impl<'a, REG> JAWDEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JAWDEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JAWDEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWDEN {
Disabled = 0,
Enabled = 1,
}
impl From<AWDEN> for bool {
#[inline(always)]
fn from(variant: AWDEN) -> Self {
variant as u8 != 0
}
}
pub type AWDEN_R = crate::BitReader<AWDEN>;
impl AWDEN_R {
#[inline(always)]
pub const fn variant(&self) -> AWDEN {
match self.bits {
false => AWDEN::Disabled,
true => AWDEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == AWDEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == AWDEN::Enabled
}
}
pub type AWDEN_W<'a, REG> = crate::BitWriter<'a, REG, AWDEN>;
impl<'a, REG> AWDEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDEN::Enabled)
}
}
impl R {
#[inline(always)]
pub fn awdch(&self) -> AWDCH_R {
AWDCH_R::new((self.bits & 0x1f) as u8)
}
#[inline(always)]
pub fn eocie(&self) -> EOCIE_R {
EOCIE_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn awdie(&self) -> AWDIE_R {
AWDIE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn jeocie(&self) -> JEOCIE_R {
JEOCIE_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn scan(&self) -> SCAN_R {
SCAN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn awdsgl(&self) -> AWDSGL_R {
AWDSGL_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn jauto(&self) -> JAUTO_R {
JAUTO_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn discen(&self) -> DISCEN_R {
DISCEN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn jdiscen(&self) -> JDISCEN_R {
JDISCEN_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn discnum(&self) -> DISCNUM_R {
DISCNUM_R::new(((self.bits >> 13) & 7) as u8)
}
#[inline(always)]
pub fn dualmod(&self) -> DUALMOD_R {
DUALMOD_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn jawden(&self) -> JAWDEN_R {
JAWDEN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn awden(&self) -> AWDEN_R {
AWDEN_R::new(((self.bits >> 23) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR1")
.field("awden", &self.awden())
.field("jawden", &self.jawden())
.field("dualmod", &self.dualmod())
.field("discnum", &self.discnum())
.field("jdiscen", &self.jdiscen())
.field("discen", &self.discen())
.field("jauto", &self.jauto())
.field("awdsgl", &self.awdsgl())
.field("scan", &self.scan())
.field("jeocie", &self.jeocie())
.field("awdie", &self.awdie())
.field("eocie", &self.eocie())
.field("awdch", &self.awdch())
.finish()
}
}
impl W {
#[inline(always)]
pub fn awdch(&mut self) -> AWDCH_W<CR1rs> {
AWDCH_W::new(self, 0)
}
#[inline(always)]
pub fn eocie(&mut self) -> EOCIE_W<CR1rs> {
EOCIE_W::new(self, 5)
}
#[inline(always)]
pub fn awdie(&mut self) -> AWDIE_W<CR1rs> {
AWDIE_W::new(self, 6)
}
#[inline(always)]
pub fn jeocie(&mut self) -> JEOCIE_W<CR1rs> {
JEOCIE_W::new(self, 7)
}
#[inline(always)]
pub fn scan(&mut self) -> SCAN_W<CR1rs> {
SCAN_W::new(self, 8)
}
#[inline(always)]
pub fn awdsgl(&mut self) -> AWDSGL_W<CR1rs> {
AWDSGL_W::new(self, 9)
}
#[inline(always)]
pub fn jauto(&mut self) -> JAUTO_W<CR1rs> {
JAUTO_W::new(self, 10)
}
#[inline(always)]
pub fn discen(&mut self) -> DISCEN_W<CR1rs> {
DISCEN_W::new(self, 11)
}
#[inline(always)]
pub fn jdiscen(&mut self) -> JDISCEN_W<CR1rs> {
JDISCEN_W::new(self, 12)
}
#[inline(always)]
pub fn discnum(&mut self) -> DISCNUM_W<CR1rs> {
DISCNUM_W::new(self, 13)
}
#[inline(always)]
pub fn dualmod(&mut self) -> DUALMOD_W<CR1rs> {
DUALMOD_W::new(self, 16)
}
#[inline(always)]
pub fn jawden(&mut self) -> JAWDEN_W<CR1rs> {
JAWDEN_W::new(self, 22)
}
#[inline(always)]
pub fn awden(&mut self) -> AWDEN_W<CR1rs> {
AWDEN_W::new(self, 23)
}
}
pub struct CR1rs;
impl crate::RegisterSpec for CR1rs {
type Ux = u32;
}
impl crate::Readable for CR1rs {}
impl crate::Writable for CR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR1rs {}