pub type R = crate::R<CR1rs>;
pub type W = crate::W<CR1rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DFEN {
Disabled = 0,
Enabled = 1,
}
impl From<DFEN> for bool {
#[inline(always)]
fn from(variant: DFEN) -> Self {
variant as u8 != 0
}
}
pub type DFEN_R = crate::BitReader<DFEN>;
impl DFEN_R {
#[inline(always)]
pub const fn variant(&self) -> DFEN {
match self.bits {
false => DFEN::Disabled,
true => DFEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DFEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DFEN::Enabled
}
}
pub type DFEN_W<'a, REG> = crate::BitWriter<'a, REG, DFEN>;
impl<'a, REG> DFEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DFEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DFEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JSWSTARTW {
Start = 1,
}
impl From<JSWSTARTW> for bool {
#[inline(always)]
fn from(variant: JSWSTARTW) -> Self {
variant as u8 != 0
}
}
pub type JSWSTART_R = crate::BitReader<JSWSTARTW>;
impl JSWSTART_R {
#[inline(always)]
pub const fn variant(&self) -> Option<JSWSTARTW> {
match self.bits {
true => Some(JSWSTARTW::Start),
_ => None,
}
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == JSWSTARTW::Start
}
}
pub type JSWSTART_W<'a, REG> = crate::BitWriter<'a, REG, JSWSTARTW>;
impl<'a, REG> JSWSTART_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn start(self) -> &'a mut crate::W<REG> {
self.variant(JSWSTARTW::Start)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JSYNC {
Disabled = 0,
Enabled = 1,
}
impl From<JSYNC> for bool {
#[inline(always)]
fn from(variant: JSYNC) -> Self {
variant as u8 != 0
}
}
pub type JSYNC_R = crate::BitReader<JSYNC>;
impl JSYNC_R {
#[inline(always)]
pub const fn variant(&self) -> JSYNC {
match self.bits {
false => JSYNC::Disabled,
true => JSYNC::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JSYNC::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JSYNC::Enabled
}
}
pub type JSYNC_W<'a, REG> = crate::BitWriter<'a, REG, JSYNC>;
impl<'a, REG> JSYNC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JSYNC::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JSYNC::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JSCAN {
Single = 0,
Series = 1,
}
impl From<JSCAN> for bool {
#[inline(always)]
fn from(variant: JSCAN) -> Self {
variant as u8 != 0
}
}
pub type JSCAN_R = crate::BitReader<JSCAN>;
impl JSCAN_R {
#[inline(always)]
pub const fn variant(&self) -> JSCAN {
match self.bits {
false => JSCAN::Single,
true => JSCAN::Series,
}
}
#[inline(always)]
pub fn is_single(&self) -> bool {
*self == JSCAN::Single
}
#[inline(always)]
pub fn is_series(&self) -> bool {
*self == JSCAN::Series
}
}
pub type JSCAN_W<'a, REG> = crate::BitWriter<'a, REG, JSCAN>;
impl<'a, REG> JSCAN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn single(self) -> &'a mut crate::W<REG> {
self.variant(JSCAN::Single)
}
#[inline(always)]
pub fn series(self) -> &'a mut crate::W<REG> {
self.variant(JSCAN::Series)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JDMAEN {
Disabled = 0,
Enabled = 1,
}
impl From<JDMAEN> for bool {
#[inline(always)]
fn from(variant: JDMAEN) -> Self {
variant as u8 != 0
}
}
pub type JDMAEN_R = crate::BitReader<JDMAEN>;
impl JDMAEN_R {
#[inline(always)]
pub const fn variant(&self) -> JDMAEN {
match self.bits {
false => JDMAEN::Disabled,
true => JDMAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JDMAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JDMAEN::Enabled
}
}
pub type JDMAEN_W<'a, REG> = crate::BitWriter<'a, REG, JDMAEN>;
impl<'a, REG> JDMAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JDMAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JDMAEN::Enabled)
}
}
pub type JEXTSEL_R = crate::FieldReader;
pub type JEXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum JEXTEN {
Disabled = 0,
RisingEdge = 1,
FallingEdge = 2,
BothEdges = 3,
}
impl From<JEXTEN> for u8 {
#[inline(always)]
fn from(variant: JEXTEN) -> Self {
variant as _
}
}
impl crate::FieldSpec for JEXTEN {
type Ux = u8;
}
impl crate::IsEnum for JEXTEN {}
pub type JEXTEN_R = crate::FieldReader<JEXTEN>;
impl JEXTEN_R {
#[inline(always)]
pub const fn variant(&self) -> JEXTEN {
match self.bits {
0 => JEXTEN::Disabled,
1 => JEXTEN::RisingEdge,
2 => JEXTEN::FallingEdge,
3 => JEXTEN::BothEdges,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JEXTEN::Disabled
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == JEXTEN::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == JEXTEN::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == JEXTEN::BothEdges
}
}
pub type JEXTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2, JEXTEN, crate::Safe>;
impl<'a, REG> JEXTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::Disabled)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::BothEdges)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RSWSTARTW {
Start = 1,
}
impl From<RSWSTARTW> for bool {
#[inline(always)]
fn from(variant: RSWSTARTW) -> Self {
variant as u8 != 0
}
}
pub type RSWSTART_R = crate::BitReader<RSWSTARTW>;
impl RSWSTART_R {
#[inline(always)]
pub const fn variant(&self) -> Option<RSWSTARTW> {
match self.bits {
true => Some(RSWSTARTW::Start),
_ => None,
}
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == RSWSTARTW::Start
}
}
pub type RSWSTART_W<'a, REG> = crate::BitWriter<'a, REG, RSWSTARTW>;
impl<'a, REG> RSWSTART_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn start(self) -> &'a mut crate::W<REG> {
self.variant(RSWSTARTW::Start)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RCONT {
Once = 0,
Continuous = 1,
}
impl From<RCONT> for bool {
#[inline(always)]
fn from(variant: RCONT) -> Self {
variant as u8 != 0
}
}
pub type RCONT_R = crate::BitReader<RCONT>;
impl RCONT_R {
#[inline(always)]
pub const fn variant(&self) -> RCONT {
match self.bits {
false => RCONT::Once,
true => RCONT::Continuous,
}
}
#[inline(always)]
pub fn is_once(&self) -> bool {
*self == RCONT::Once
}
#[inline(always)]
pub fn is_continuous(&self) -> bool {
*self == RCONT::Continuous
}
}
pub type RCONT_W<'a, REG> = crate::BitWriter<'a, REG, RCONT>;
impl<'a, REG> RCONT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn once(self) -> &'a mut crate::W<REG> {
self.variant(RCONT::Once)
}
#[inline(always)]
pub fn continuous(self) -> &'a mut crate::W<REG> {
self.variant(RCONT::Continuous)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RSYNC {
NoLaunch = 0,
Launch = 1,
}
impl From<RSYNC> for bool {
#[inline(always)]
fn from(variant: RSYNC) -> Self {
variant as u8 != 0
}
}
pub type RSYNC_R = crate::BitReader<RSYNC>;
impl RSYNC_R {
#[inline(always)]
pub const fn variant(&self) -> RSYNC {
match self.bits {
false => RSYNC::NoLaunch,
true => RSYNC::Launch,
}
}
#[inline(always)]
pub fn is_no_launch(&self) -> bool {
*self == RSYNC::NoLaunch
}
#[inline(always)]
pub fn is_launch(&self) -> bool {
*self == RSYNC::Launch
}
}
pub type RSYNC_W<'a, REG> = crate::BitWriter<'a, REG, RSYNC>;
impl<'a, REG> RSYNC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_launch(self) -> &'a mut crate::W<REG> {
self.variant(RSYNC::NoLaunch)
}
#[inline(always)]
pub fn launch(self) -> &'a mut crate::W<REG> {
self.variant(RSYNC::Launch)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RDMAEN {
Disabled = 0,
Enabled = 1,
}
impl From<RDMAEN> for bool {
#[inline(always)]
fn from(variant: RDMAEN) -> Self {
variant as u8 != 0
}
}
pub type RDMAEN_R = crate::BitReader<RDMAEN>;
impl RDMAEN_R {
#[inline(always)]
pub const fn variant(&self) -> RDMAEN {
match self.bits {
false => RDMAEN::Disabled,
true => RDMAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RDMAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RDMAEN::Enabled
}
}
pub type RDMAEN_W<'a, REG> = crate::BitWriter<'a, REG, RDMAEN>;
impl<'a, REG> RDMAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RDMAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RDMAEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RCH {
Channel0 = 0,
Channel1 = 1,
Channel2 = 2,
Channel3 = 3,
Channel4 = 4,
Channel5 = 5,
Channel6 = 6,
Channel7 = 7,
}
impl From<RCH> for u8 {
#[inline(always)]
fn from(variant: RCH) -> Self {
variant as _
}
}
impl crate::FieldSpec for RCH {
type Ux = u8;
}
impl crate::IsEnum for RCH {}
pub type RCH_R = crate::FieldReader<RCH>;
impl RCH_R {
#[inline(always)]
pub const fn variant(&self) -> RCH {
match self.bits {
0 => RCH::Channel0,
1 => RCH::Channel1,
2 => RCH::Channel2,
3 => RCH::Channel3,
4 => RCH::Channel4,
5 => RCH::Channel5,
6 => RCH::Channel6,
7 => RCH::Channel7,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_channel0(&self) -> bool {
*self == RCH::Channel0
}
#[inline(always)]
pub fn is_channel1(&self) -> bool {
*self == RCH::Channel1
}
#[inline(always)]
pub fn is_channel2(&self) -> bool {
*self == RCH::Channel2
}
#[inline(always)]
pub fn is_channel3(&self) -> bool {
*self == RCH::Channel3
}
#[inline(always)]
pub fn is_channel4(&self) -> bool {
*self == RCH::Channel4
}
#[inline(always)]
pub fn is_channel5(&self) -> bool {
*self == RCH::Channel5
}
#[inline(always)]
pub fn is_channel6(&self) -> bool {
*self == RCH::Channel6
}
#[inline(always)]
pub fn is_channel7(&self) -> bool {
*self == RCH::Channel7
}
}
pub type RCH_W<'a, REG> = crate::FieldWriter<'a, REG, 3, RCH, crate::Safe>;
impl<'a, REG> RCH_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn channel0(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel0)
}
#[inline(always)]
pub fn channel1(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel1)
}
#[inline(always)]
pub fn channel2(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel2)
}
#[inline(always)]
pub fn channel3(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel3)
}
#[inline(always)]
pub fn channel4(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel4)
}
#[inline(always)]
pub fn channel5(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel5)
}
#[inline(always)]
pub fn channel6(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel6)
}
#[inline(always)]
pub fn channel7(self) -> &'a mut crate::W<REG> {
self.variant(RCH::Channel7)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FAST {
Disabled = 0,
Enabled = 1,
}
impl From<FAST> for bool {
#[inline(always)]
fn from(variant: FAST) -> Self {
variant as u8 != 0
}
}
pub type FAST_R = crate::BitReader<FAST>;
impl FAST_R {
#[inline(always)]
pub const fn variant(&self) -> FAST {
match self.bits {
false => FAST::Disabled,
true => FAST::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FAST::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == FAST::Enabled
}
}
pub type FAST_W<'a, REG> = crate::BitWriter<'a, REG, FAST>;
impl<'a, REG> FAST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FAST::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(FAST::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWFSEL {
Output = 0,
Transceiver = 1,
}
impl From<AWFSEL> for bool {
#[inline(always)]
fn from(variant: AWFSEL) -> Self {
variant as u8 != 0
}
}
pub type AWFSEL_R = crate::BitReader<AWFSEL>;
impl AWFSEL_R {
#[inline(always)]
pub const fn variant(&self) -> AWFSEL {
match self.bits {
false => AWFSEL::Output,
true => AWFSEL::Transceiver,
}
}
#[inline(always)]
pub fn is_output(&self) -> bool {
*self == AWFSEL::Output
}
#[inline(always)]
pub fn is_transceiver(&self) -> bool {
*self == AWFSEL::Transceiver
}
}
pub type AWFSEL_W<'a, REG> = crate::BitWriter<'a, REG, AWFSEL>;
impl<'a, REG> AWFSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn output(self) -> &'a mut crate::W<REG> {
self.variant(AWFSEL::Output)
}
#[inline(always)]
pub fn transceiver(self) -> &'a mut crate::W<REG> {
self.variant(AWFSEL::Transceiver)
}
}
impl R {
#[inline(always)]
pub fn dfen(&self) -> DFEN_R {
DFEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn jswstart(&self) -> JSWSTART_R {
JSWSTART_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn jsync(&self) -> JSYNC_R {
JSYNC_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn jscan(&self) -> JSCAN_R {
JSCAN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn jdmaen(&self) -> JDMAEN_R {
JDMAEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn jextsel(&self) -> JEXTSEL_R {
JEXTSEL_R::new(((self.bits >> 8) & 0x1f) as u8)
}
#[inline(always)]
pub fn jexten(&self) -> JEXTEN_R {
JEXTEN_R::new(((self.bits >> 13) & 3) as u8)
}
#[inline(always)]
pub fn rswstart(&self) -> RSWSTART_R {
RSWSTART_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn rcont(&self) -> RCONT_R {
RCONT_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn rsync(&self) -> RSYNC_R {
RSYNC_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn rdmaen(&self) -> RDMAEN_R {
RDMAEN_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn rch(&self) -> RCH_R {
RCH_R::new(((self.bits >> 24) & 7) as u8)
}
#[inline(always)]
pub fn fast(&self) -> FAST_R {
FAST_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn awfsel(&self) -> AWFSEL_R {
AWFSEL_R::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR1")
.field("awfsel", &self.awfsel())
.field("fast", &self.fast())
.field("rch", &self.rch())
.field("rdmaen", &self.rdmaen())
.field("rsync", &self.rsync())
.field("rcont", &self.rcont())
.field("rswstart", &self.rswstart())
.field("jexten", &self.jexten())
.field("jextsel", &self.jextsel())
.field("jdmaen", &self.jdmaen())
.field("jscan", &self.jscan())
.field("jsync", &self.jsync())
.field("jswstart", &self.jswstart())
.field("dfen", &self.dfen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dfen(&mut self) -> DFEN_W<CR1rs> {
DFEN_W::new(self, 0)
}
#[inline(always)]
pub fn jswstart(&mut self) -> JSWSTART_W<CR1rs> {
JSWSTART_W::new(self, 1)
}
#[inline(always)]
pub fn jsync(&mut self) -> JSYNC_W<CR1rs> {
JSYNC_W::new(self, 3)
}
#[inline(always)]
pub fn jscan(&mut self) -> JSCAN_W<CR1rs> {
JSCAN_W::new(self, 4)
}
#[inline(always)]
pub fn jdmaen(&mut self) -> JDMAEN_W<CR1rs> {
JDMAEN_W::new(self, 5)
}
#[inline(always)]
pub fn jextsel(&mut self) -> JEXTSEL_W<CR1rs> {
JEXTSEL_W::new(self, 8)
}
#[inline(always)]
pub fn jexten(&mut self) -> JEXTEN_W<CR1rs> {
JEXTEN_W::new(self, 13)
}
#[inline(always)]
pub fn rswstart(&mut self) -> RSWSTART_W<CR1rs> {
RSWSTART_W::new(self, 17)
}
#[inline(always)]
pub fn rcont(&mut self) -> RCONT_W<CR1rs> {
RCONT_W::new(self, 18)
}
#[inline(always)]
pub fn rsync(&mut self) -> RSYNC_W<CR1rs> {
RSYNC_W::new(self, 19)
}
#[inline(always)]
pub fn rdmaen(&mut self) -> RDMAEN_W<CR1rs> {
RDMAEN_W::new(self, 21)
}
#[inline(always)]
pub fn rch(&mut self) -> RCH_W<CR1rs> {
RCH_W::new(self, 24)
}
#[inline(always)]
pub fn fast(&mut self) -> FAST_W<CR1rs> {
FAST_W::new(self, 29)
}
#[inline(always)]
pub fn awfsel(&mut self) -> AWFSEL_W<CR1rs> {
AWFSEL_W::new(self, 30)
}
}
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 {}