pub type R = crate::R<CR2rs>;
pub type W = crate::W<CR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADON {
Disabled = 0,
Enabled = 1,
}
impl From<ADON> for bool {
#[inline(always)]
fn from(variant: ADON) -> Self {
variant as u8 != 0
}
}
pub type ADON_R = crate::BitReader<ADON>;
impl ADON_R {
#[inline(always)]
pub const fn variant(&self) -> ADON {
match self.bits {
false => ADON::Disabled,
true => ADON::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ADON::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ADON::Enabled
}
}
pub type ADON_W<'a, REG> = crate::BitWriter<'a, REG, ADON>;
impl<'a, REG> ADON_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ADON::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ADON::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CONT {
Single = 0,
Continuous = 1,
}
impl From<CONT> for bool {
#[inline(always)]
fn from(variant: CONT) -> Self {
variant as u8 != 0
}
}
pub type CONT_R = crate::BitReader<CONT>;
impl CONT_R {
#[inline(always)]
pub const fn variant(&self) -> CONT {
match self.bits {
false => CONT::Single,
true => CONT::Continuous,
}
}
#[inline(always)]
pub fn is_single(&self) -> bool {
*self == CONT::Single
}
#[inline(always)]
pub fn is_continuous(&self) -> bool {
*self == CONT::Continuous
}
}
pub type CONT_W<'a, REG> = crate::BitWriter<'a, REG, CONT>;
impl<'a, REG> CONT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn single(self) -> &'a mut crate::W<REG> {
self.variant(CONT::Single)
}
#[inline(always)]
pub fn continuous(self) -> &'a mut crate::W<REG> {
self.variant(CONT::Continuous)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMA {
Disabled = 0,
Enabled = 1,
}
impl From<DMA> for bool {
#[inline(always)]
fn from(variant: DMA) -> Self {
variant as u8 != 0
}
}
pub type DMA_R = crate::BitReader<DMA>;
impl DMA_R {
#[inline(always)]
pub const fn variant(&self) -> DMA {
match self.bits {
false => DMA::Disabled,
true => DMA::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DMA::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DMA::Enabled
}
}
pub type DMA_W<'a, REG> = crate::BitWriter<'a, REG, DMA>;
impl<'a, REG> DMA_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DMA::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DMA::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DDS {
Single = 0,
Continuous = 1,
}
impl From<DDS> for bool {
#[inline(always)]
fn from(variant: DDS) -> Self {
variant as u8 != 0
}
}
pub type DDS_R = crate::BitReader<DDS>;
impl DDS_R {
#[inline(always)]
pub const fn variant(&self) -> DDS {
match self.bits {
false => DDS::Single,
true => DDS::Continuous,
}
}
#[inline(always)]
pub fn is_single(&self) -> bool {
*self == DDS::Single
}
#[inline(always)]
pub fn is_continuous(&self) -> bool {
*self == DDS::Continuous
}
}
pub type DDS_W<'a, REG> = crate::BitWriter<'a, REG, DDS>;
impl<'a, REG> DDS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn single(self) -> &'a mut crate::W<REG> {
self.variant(DDS::Single)
}
#[inline(always)]
pub fn continuous(self) -> &'a mut crate::W<REG> {
self.variant(DDS::Continuous)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EOCS {
EachSequence = 0,
EachConversion = 1,
}
impl From<EOCS> for bool {
#[inline(always)]
fn from(variant: EOCS) -> Self {
variant as u8 != 0
}
}
pub type EOCS_R = crate::BitReader<EOCS>;
impl EOCS_R {
#[inline(always)]
pub const fn variant(&self) -> EOCS {
match self.bits {
false => EOCS::EachSequence,
true => EOCS::EachConversion,
}
}
#[inline(always)]
pub fn is_each_sequence(&self) -> bool {
*self == EOCS::EachSequence
}
#[inline(always)]
pub fn is_each_conversion(&self) -> bool {
*self == EOCS::EachConversion
}
}
pub type EOCS_W<'a, REG> = crate::BitWriter<'a, REG, EOCS>;
impl<'a, REG> EOCS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn each_sequence(self) -> &'a mut crate::W<REG> {
self.variant(EOCS::EachSequence)
}
#[inline(always)]
pub fn each_conversion(self) -> &'a mut crate::W<REG> {
self.variant(EOCS::EachConversion)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALIGN {
Right = 0,
Left = 1,
}
impl From<ALIGN> for bool {
#[inline(always)]
fn from(variant: ALIGN) -> Self {
variant as u8 != 0
}
}
pub type ALIGN_R = crate::BitReader<ALIGN>;
impl ALIGN_R {
#[inline(always)]
pub const fn variant(&self) -> ALIGN {
match self.bits {
false => ALIGN::Right,
true => ALIGN::Left,
}
}
#[inline(always)]
pub fn is_right(&self) -> bool {
*self == ALIGN::Right
}
#[inline(always)]
pub fn is_left(&self) -> bool {
*self == ALIGN::Left
}
}
pub type ALIGN_W<'a, REG> = crate::BitWriter<'a, REG, ALIGN>;
impl<'a, REG> ALIGN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn right(self) -> &'a mut crate::W<REG> {
self.variant(ALIGN::Right)
}
#[inline(always)]
pub fn left(self) -> &'a mut crate::W<REG> {
self.variant(ALIGN::Left)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum JEXTSEL {
Tim1cc4 = 0,
Tim1trgo = 1,
Tim2cc1 = 2,
Tim2trgo = 3,
Tim3cc2 = 4,
Tim3cc4 = 5,
Tim4cc1 = 6,
Tim4cc2 = 7,
Tim4cc3 = 8,
Tim4trgo = 9,
Tim5cc4 = 10,
Tim5trgo = 11,
Tim8cc2 = 12,
Tim8cc3 = 13,
Tim8cc4 = 14,
Exti15 = 15,
}
impl From<JEXTSEL> for u8 {
#[inline(always)]
fn from(variant: JEXTSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for JEXTSEL {
type Ux = u8;
}
impl crate::IsEnum for JEXTSEL {}
pub type JEXTSEL_R = crate::FieldReader<JEXTSEL>;
impl JEXTSEL_R {
#[inline(always)]
pub const fn variant(&self) -> JEXTSEL {
match self.bits {
0 => JEXTSEL::Tim1cc4,
1 => JEXTSEL::Tim1trgo,
2 => JEXTSEL::Tim2cc1,
3 => JEXTSEL::Tim2trgo,
4 => JEXTSEL::Tim3cc2,
5 => JEXTSEL::Tim3cc4,
6 => JEXTSEL::Tim4cc1,
7 => JEXTSEL::Tim4cc2,
8 => JEXTSEL::Tim4cc3,
9 => JEXTSEL::Tim4trgo,
10 => JEXTSEL::Tim5cc4,
11 => JEXTSEL::Tim5trgo,
12 => JEXTSEL::Tim8cc2,
13 => JEXTSEL::Tim8cc3,
14 => JEXTSEL::Tim8cc4,
15 => JEXTSEL::Exti15,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_tim1cc4(&self) -> bool {
*self == JEXTSEL::Tim1cc4
}
#[inline(always)]
pub fn is_tim1trgo(&self) -> bool {
*self == JEXTSEL::Tim1trgo
}
#[inline(always)]
pub fn is_tim2cc1(&self) -> bool {
*self == JEXTSEL::Tim2cc1
}
#[inline(always)]
pub fn is_tim2trgo(&self) -> bool {
*self == JEXTSEL::Tim2trgo
}
#[inline(always)]
pub fn is_tim3cc2(&self) -> bool {
*self == JEXTSEL::Tim3cc2
}
#[inline(always)]
pub fn is_tim3cc4(&self) -> bool {
*self == JEXTSEL::Tim3cc4
}
#[inline(always)]
pub fn is_tim4cc1(&self) -> bool {
*self == JEXTSEL::Tim4cc1
}
#[inline(always)]
pub fn is_tim4cc2(&self) -> bool {
*self == JEXTSEL::Tim4cc2
}
#[inline(always)]
pub fn is_tim4cc3(&self) -> bool {
*self == JEXTSEL::Tim4cc3
}
#[inline(always)]
pub fn is_tim4trgo(&self) -> bool {
*self == JEXTSEL::Tim4trgo
}
#[inline(always)]
pub fn is_tim5cc4(&self) -> bool {
*self == JEXTSEL::Tim5cc4
}
#[inline(always)]
pub fn is_tim5trgo(&self) -> bool {
*self == JEXTSEL::Tim5trgo
}
#[inline(always)]
pub fn is_tim8cc2(&self) -> bool {
*self == JEXTSEL::Tim8cc2
}
#[inline(always)]
pub fn is_tim8cc3(&self) -> bool {
*self == JEXTSEL::Tim8cc3
}
#[inline(always)]
pub fn is_tim8cc4(&self) -> bool {
*self == JEXTSEL::Tim8cc4
}
#[inline(always)]
pub fn is_exti15(&self) -> bool {
*self == JEXTSEL::Exti15
}
}
pub type JEXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4, JEXTSEL, crate::Safe>;
impl<'a, REG> JEXTSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn tim1cc4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim1cc4)
}
#[inline(always)]
pub fn tim1trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim1trgo)
}
#[inline(always)]
pub fn tim2cc1(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim2cc1)
}
#[inline(always)]
pub fn tim2trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim2trgo)
}
#[inline(always)]
pub fn tim3cc2(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim3cc2)
}
#[inline(always)]
pub fn tim3cc4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim3cc4)
}
#[inline(always)]
pub fn tim4cc1(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim4cc1)
}
#[inline(always)]
pub fn tim4cc2(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim4cc2)
}
#[inline(always)]
pub fn tim4cc3(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim4cc3)
}
#[inline(always)]
pub fn tim4trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim4trgo)
}
#[inline(always)]
pub fn tim5cc4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim5cc4)
}
#[inline(always)]
pub fn tim5trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim5trgo)
}
#[inline(always)]
pub fn tim8cc2(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim8cc2)
}
#[inline(always)]
pub fn tim8cc3(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim8cc3)
}
#[inline(always)]
pub fn tim8cc4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim8cc4)
}
#[inline(always)]
pub fn exti15(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Exti15)
}
}
#[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 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)]
#[repr(u8)]
pub enum EXTSEL {
Tim1cc1 = 0,
Tim1cc2 = 1,
Tim1cc3 = 2,
Tim2cc2 = 3,
Tim2cc3 = 4,
Tim2cc4 = 5,
Tim2trgo = 6,
Tim3cc1 = 7,
Tim3trgo = 8,
Tim4cc4 = 9,
Tim5cc1 = 10,
Tim5cc2 = 11,
Tim5cc3 = 12,
Tim8cc1 = 13,
Tim8trgo = 14,
Exti11 = 15,
}
impl From<EXTSEL> for u8 {
#[inline(always)]
fn from(variant: EXTSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for EXTSEL {
type Ux = u8;
}
impl crate::IsEnum for EXTSEL {}
pub type EXTSEL_R = crate::FieldReader<EXTSEL>;
impl EXTSEL_R {
#[inline(always)]
pub const fn variant(&self) -> EXTSEL {
match self.bits {
0 => EXTSEL::Tim1cc1,
1 => EXTSEL::Tim1cc2,
2 => EXTSEL::Tim1cc3,
3 => EXTSEL::Tim2cc2,
4 => EXTSEL::Tim2cc3,
5 => EXTSEL::Tim2cc4,
6 => EXTSEL::Tim2trgo,
7 => EXTSEL::Tim3cc1,
8 => EXTSEL::Tim3trgo,
9 => EXTSEL::Tim4cc4,
10 => EXTSEL::Tim5cc1,
11 => EXTSEL::Tim5cc2,
12 => EXTSEL::Tim5cc3,
13 => EXTSEL::Tim8cc1,
14 => EXTSEL::Tim8trgo,
15 => EXTSEL::Exti11,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_tim1cc1(&self) -> bool {
*self == EXTSEL::Tim1cc1
}
#[inline(always)]
pub fn is_tim1cc2(&self) -> bool {
*self == EXTSEL::Tim1cc2
}
#[inline(always)]
pub fn is_tim1cc3(&self) -> bool {
*self == EXTSEL::Tim1cc3
}
#[inline(always)]
pub fn is_tim2cc2(&self) -> bool {
*self == EXTSEL::Tim2cc2
}
#[inline(always)]
pub fn is_tim2cc3(&self) -> bool {
*self == EXTSEL::Tim2cc3
}
#[inline(always)]
pub fn is_tim2cc4(&self) -> bool {
*self == EXTSEL::Tim2cc4
}
#[inline(always)]
pub fn is_tim2trgo(&self) -> bool {
*self == EXTSEL::Tim2trgo
}
#[inline(always)]
pub fn is_tim3cc1(&self) -> bool {
*self == EXTSEL::Tim3cc1
}
#[inline(always)]
pub fn is_tim3trgo(&self) -> bool {
*self == EXTSEL::Tim3trgo
}
#[inline(always)]
pub fn is_tim4cc4(&self) -> bool {
*self == EXTSEL::Tim4cc4
}
#[inline(always)]
pub fn is_tim5cc1(&self) -> bool {
*self == EXTSEL::Tim5cc1
}
#[inline(always)]
pub fn is_tim5cc2(&self) -> bool {
*self == EXTSEL::Tim5cc2
}
#[inline(always)]
pub fn is_tim5cc3(&self) -> bool {
*self == EXTSEL::Tim5cc3
}
#[inline(always)]
pub fn is_tim8cc1(&self) -> bool {
*self == EXTSEL::Tim8cc1
}
#[inline(always)]
pub fn is_tim8trgo(&self) -> bool {
*self == EXTSEL::Tim8trgo
}
#[inline(always)]
pub fn is_exti11(&self) -> bool {
*self == EXTSEL::Exti11
}
}
pub type EXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4, EXTSEL, crate::Safe>;
impl<'a, REG> EXTSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn tim1cc1(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim1cc1)
}
#[inline(always)]
pub fn tim1cc2(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim1cc2)
}
#[inline(always)]
pub fn tim1cc3(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim1cc3)
}
#[inline(always)]
pub fn tim2cc2(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim2cc2)
}
#[inline(always)]
pub fn tim2cc3(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim2cc3)
}
#[inline(always)]
pub fn tim2cc4(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim2cc4)
}
#[inline(always)]
pub fn tim2trgo(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim2trgo)
}
#[inline(always)]
pub fn tim3cc1(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim3cc1)
}
#[inline(always)]
pub fn tim3trgo(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim3trgo)
}
#[inline(always)]
pub fn tim4cc4(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim4cc4)
}
#[inline(always)]
pub fn tim5cc1(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim5cc1)
}
#[inline(always)]
pub fn tim5cc2(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim5cc2)
}
#[inline(always)]
pub fn tim5cc3(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim5cc3)
}
#[inline(always)]
pub fn tim8cc1(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim8cc1)
}
#[inline(always)]
pub fn tim8trgo(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Tim8trgo)
}
#[inline(always)]
pub fn exti11(self) -> &'a mut crate::W<REG> {
self.variant(EXTSEL::Exti11)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EXTEN {
Disabled = 0,
RisingEdge = 1,
FallingEdge = 2,
BothEdges = 3,
}
impl From<EXTEN> for u8 {
#[inline(always)]
fn from(variant: EXTEN) -> Self {
variant as _
}
}
impl crate::FieldSpec for EXTEN {
type Ux = u8;
}
impl crate::IsEnum for EXTEN {}
pub type EXTEN_R = crate::FieldReader<EXTEN>;
impl EXTEN_R {
#[inline(always)]
pub const fn variant(&self) -> EXTEN {
match self.bits {
0 => EXTEN::Disabled,
1 => EXTEN::RisingEdge,
2 => EXTEN::FallingEdge,
3 => EXTEN::BothEdges,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EXTEN::Disabled
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == EXTEN::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == EXTEN::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == EXTEN::BothEdges
}
}
pub type EXTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EXTEN, crate::Safe>;
impl<'a, REG> EXTEN_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(EXTEN::Disabled)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(EXTEN::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(EXTEN::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(EXTEN::BothEdges)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SWSTARTW {
Start = 1,
}
impl From<SWSTARTW> for bool {
#[inline(always)]
fn from(variant: SWSTARTW) -> Self {
variant as u8 != 0
}
}
pub type SWSTART_R = crate::BitReader<SWSTARTW>;
impl SWSTART_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SWSTARTW> {
match self.bits {
true => Some(SWSTARTW::Start),
_ => None,
}
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == SWSTARTW::Start
}
}
pub type SWSTART_W<'a, REG> = crate::BitWriter<'a, REG, SWSTARTW>;
impl<'a, REG> SWSTART_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn start(self) -> &'a mut crate::W<REG> {
self.variant(SWSTARTW::Start)
}
}
impl R {
#[inline(always)]
pub fn adon(&self) -> ADON_R {
ADON_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cont(&self) -> CONT_R {
CONT_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn dma(&self) -> DMA_R {
DMA_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn dds(&self) -> DDS_R {
DDS_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn eocs(&self) -> EOCS_R {
EOCS_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn align(&self) -> ALIGN_R {
ALIGN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn jextsel(&self) -> JEXTSEL_R {
JEXTSEL_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn jexten(&self) -> JEXTEN_R {
JEXTEN_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn jswstart(&self) -> JSWSTART_R {
JSWSTART_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn extsel(&self) -> EXTSEL_R {
EXTSEL_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn exten(&self) -> EXTEN_R {
EXTEN_R::new(((self.bits >> 28) & 3) as u8)
}
#[inline(always)]
pub fn swstart(&self) -> SWSTART_R {
SWSTART_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("CR2")
.field("swstart", &self.swstart())
.field("exten", &self.exten())
.field("extsel", &self.extsel())
.field("jswstart", &self.jswstart())
.field("jexten", &self.jexten())
.field("jextsel", &self.jextsel())
.field("align", &self.align())
.field("eocs", &self.eocs())
.field("dds", &self.dds())
.field("dma", &self.dma())
.field("cont", &self.cont())
.field("adon", &self.adon())
.finish()
}
}
impl W {
#[inline(always)]
pub fn adon(&mut self) -> ADON_W<CR2rs> {
ADON_W::new(self, 0)
}
#[inline(always)]
pub fn cont(&mut self) -> CONT_W<CR2rs> {
CONT_W::new(self, 1)
}
#[inline(always)]
pub fn dma(&mut self) -> DMA_W<CR2rs> {
DMA_W::new(self, 8)
}
#[inline(always)]
pub fn dds(&mut self) -> DDS_W<CR2rs> {
DDS_W::new(self, 9)
}
#[inline(always)]
pub fn eocs(&mut self) -> EOCS_W<CR2rs> {
EOCS_W::new(self, 10)
}
#[inline(always)]
pub fn align(&mut self) -> ALIGN_W<CR2rs> {
ALIGN_W::new(self, 11)
}
#[inline(always)]
pub fn jextsel(&mut self) -> JEXTSEL_W<CR2rs> {
JEXTSEL_W::new(self, 16)
}
#[inline(always)]
pub fn jexten(&mut self) -> JEXTEN_W<CR2rs> {
JEXTEN_W::new(self, 20)
}
#[inline(always)]
pub fn jswstart(&mut self) -> JSWSTART_W<CR2rs> {
JSWSTART_W::new(self, 22)
}
#[inline(always)]
pub fn extsel(&mut self) -> EXTSEL_W<CR2rs> {
EXTSEL_W::new(self, 24)
}
#[inline(always)]
pub fn exten(&mut self) -> EXTEN_W<CR2rs> {
EXTEN_W::new(self, 28)
}
#[inline(always)]
pub fn swstart(&mut self) -> SWSTART_W<CR2rs> {
SWSTART_W::new(self, 30)
}
}
pub struct CR2rs;
impl crate::RegisterSpec for CR2rs {
type Ux = u32;
}
impl crate::Readable for CR2rs {}
impl crate::Writable for CR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR2rs {}