pub type R = crate::R<CFGRrs>;
pub type W = crate::W<CFGRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CKSEL {
Internal = 0,
External = 1,
}
impl From<CKSEL> for bool {
#[inline(always)]
fn from(variant: CKSEL) -> Self {
variant as u8 != 0
}
}
pub type CKSEL_R = crate::BitReader<CKSEL>;
impl CKSEL_R {
#[inline(always)]
pub const fn variant(&self) -> CKSEL {
match self.bits {
false => CKSEL::Internal,
true => CKSEL::External,
}
}
#[inline(always)]
pub fn is_internal(&self) -> bool {
*self == CKSEL::Internal
}
#[inline(always)]
pub fn is_external(&self) -> bool {
*self == CKSEL::External
}
}
pub type CKSEL_W<'a, REG> = crate::BitWriter<'a, REG, CKSEL>;
impl<'a, REG> CKSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn internal(self) -> &'a mut crate::W<REG> {
self.variant(CKSEL::Internal)
}
#[inline(always)]
pub fn external(self) -> &'a mut crate::W<REG> {
self.variant(CKSEL::External)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CKPOL {
RisingEdge = 0,
FallingEdge = 1,
BothEdges = 2,
}
impl From<CKPOL> for u8 {
#[inline(always)]
fn from(variant: CKPOL) -> Self {
variant as _
}
}
impl crate::FieldSpec for CKPOL {
type Ux = u8;
}
impl crate::IsEnum for CKPOL {}
pub type CKPOL_R = crate::FieldReader<CKPOL>;
impl CKPOL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CKPOL> {
match self.bits {
0 => Some(CKPOL::RisingEdge),
1 => Some(CKPOL::FallingEdge),
2 => Some(CKPOL::BothEdges),
_ => None,
}
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == CKPOL::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == CKPOL::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == CKPOL::BothEdges
}
}
pub type CKPOL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CKPOL>;
impl<'a, REG> CKPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(CKPOL::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(CKPOL::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(CKPOL::BothEdges)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CKFLT {
Immediate = 0,
Clocks2 = 1,
Clocks4 = 2,
Clocks8 = 3,
}
impl From<CKFLT> for u8 {
#[inline(always)]
fn from(variant: CKFLT) -> Self {
variant as _
}
}
impl crate::FieldSpec for CKFLT {
type Ux = u8;
}
impl crate::IsEnum for CKFLT {}
pub type CKFLT_R = crate::FieldReader<CKFLT>;
impl CKFLT_R {
#[inline(always)]
pub const fn variant(&self) -> CKFLT {
match self.bits {
0 => CKFLT::Immediate,
1 => CKFLT::Clocks2,
2 => CKFLT::Clocks4,
3 => CKFLT::Clocks8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_immediate(&self) -> bool {
*self == CKFLT::Immediate
}
#[inline(always)]
pub fn is_clocks2(&self) -> bool {
*self == CKFLT::Clocks2
}
#[inline(always)]
pub fn is_clocks4(&self) -> bool {
*self == CKFLT::Clocks4
}
#[inline(always)]
pub fn is_clocks8(&self) -> bool {
*self == CKFLT::Clocks8
}
}
pub type CKFLT_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CKFLT, crate::Safe>;
impl<'a, REG> CKFLT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn immediate(self) -> &'a mut crate::W<REG> {
self.variant(CKFLT::Immediate)
}
#[inline(always)]
pub fn clocks2(self) -> &'a mut crate::W<REG> {
self.variant(CKFLT::Clocks2)
}
#[inline(always)]
pub fn clocks4(self) -> &'a mut crate::W<REG> {
self.variant(CKFLT::Clocks4)
}
#[inline(always)]
pub fn clocks8(self) -> &'a mut crate::W<REG> {
self.variant(CKFLT::Clocks8)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TRGFLT {
Immediate = 0,
Clocks2 = 1,
Clocks4 = 2,
Clocks8 = 3,
}
impl From<TRGFLT> for u8 {
#[inline(always)]
fn from(variant: TRGFLT) -> Self {
variant as _
}
}
impl crate::FieldSpec for TRGFLT {
type Ux = u8;
}
impl crate::IsEnum for TRGFLT {}
pub type TRGFLT_R = crate::FieldReader<TRGFLT>;
impl TRGFLT_R {
#[inline(always)]
pub const fn variant(&self) -> TRGFLT {
match self.bits {
0 => TRGFLT::Immediate,
1 => TRGFLT::Clocks2,
2 => TRGFLT::Clocks4,
3 => TRGFLT::Clocks8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_immediate(&self) -> bool {
*self == TRGFLT::Immediate
}
#[inline(always)]
pub fn is_clocks2(&self) -> bool {
*self == TRGFLT::Clocks2
}
#[inline(always)]
pub fn is_clocks4(&self) -> bool {
*self == TRGFLT::Clocks4
}
#[inline(always)]
pub fn is_clocks8(&self) -> bool {
*self == TRGFLT::Clocks8
}
}
pub type TRGFLT_W<'a, REG> = crate::FieldWriter<'a, REG, 2, TRGFLT, crate::Safe>;
impl<'a, REG> TRGFLT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn immediate(self) -> &'a mut crate::W<REG> {
self.variant(TRGFLT::Immediate)
}
#[inline(always)]
pub fn clocks2(self) -> &'a mut crate::W<REG> {
self.variant(TRGFLT::Clocks2)
}
#[inline(always)]
pub fn clocks4(self) -> &'a mut crate::W<REG> {
self.variant(TRGFLT::Clocks4)
}
#[inline(always)]
pub fn clocks8(self) -> &'a mut crate::W<REG> {
self.variant(TRGFLT::Clocks8)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PRESC {
Div1 = 0,
Div2 = 1,
Div4 = 2,
Div8 = 3,
Div16 = 4,
Div32 = 5,
Div64 = 6,
Div128 = 7,
}
impl From<PRESC> for u8 {
#[inline(always)]
fn from(variant: PRESC) -> Self {
variant as _
}
}
impl crate::FieldSpec for PRESC {
type Ux = u8;
}
impl crate::IsEnum for PRESC {}
pub type PRESC_R = crate::FieldReader<PRESC>;
impl PRESC_R {
#[inline(always)]
pub const fn variant(&self) -> PRESC {
match self.bits {
0 => PRESC::Div1,
1 => PRESC::Div2,
2 => PRESC::Div4,
3 => PRESC::Div8,
4 => PRESC::Div16,
5 => PRESC::Div32,
6 => PRESC::Div64,
7 => PRESC::Div128,
_ => unreachable!(),
}
}
#[doc = "/1"]
#[inline(always)]
pub fn is_div1(&self) -> bool {
*self == PRESC::Div1
}
#[doc = "/2"]
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == PRESC::Div2
}
#[doc = "/4"]
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == PRESC::Div4
}
#[doc = "/8"]
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == PRESC::Div8
}
#[doc = "/16"]
#[inline(always)]
pub fn is_div16(&self) -> bool {
*self == PRESC::Div16
}
#[doc = "/32"]
#[inline(always)]
pub fn is_div32(&self) -> bool {
*self == PRESC::Div32
}
#[doc = "/64"]
#[inline(always)]
pub fn is_div64(&self) -> bool {
*self == PRESC::Div64
}
#[doc = "/128"]
#[inline(always)]
pub fn is_div128(&self) -> bool {
*self == PRESC::Div128
}
}
pub type PRESC_W<'a, REG> = crate::FieldWriter<'a, REG, 3, PRESC, crate::Safe>;
impl<'a, REG> PRESC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[doc = "/1"]
#[inline(always)]
pub fn div1(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div1)
}
#[doc = "/2"]
#[inline(always)]
pub fn div2(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div2)
}
#[doc = "/4"]
#[inline(always)]
pub fn div4(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div4)
}
#[doc = "/8"]
#[inline(always)]
pub fn div8(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div8)
}
#[doc = "/16"]
#[inline(always)]
pub fn div16(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div16)
}
#[doc = "/32"]
#[inline(always)]
pub fn div32(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div32)
}
#[doc = "/64"]
#[inline(always)]
pub fn div64(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div64)
}
#[doc = "/128"]
#[inline(always)]
pub fn div128(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Div128)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TRIGSEL {
Trig0 = 0,
Trig1 = 1,
Trig2 = 2,
Trig3 = 3,
Trig4 = 4,
Trig5 = 5,
Trig6 = 6,
Trig7 = 7,
}
impl From<TRIGSEL> for u8 {
#[inline(always)]
fn from(variant: TRIGSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for TRIGSEL {
type Ux = u8;
}
impl crate::IsEnum for TRIGSEL {}
pub type TRIGSEL_R = crate::FieldReader<TRIGSEL>;
impl TRIGSEL_R {
#[inline(always)]
pub const fn variant(&self) -> TRIGSEL {
match self.bits {
0 => TRIGSEL::Trig0,
1 => TRIGSEL::Trig1,
2 => TRIGSEL::Trig2,
3 => TRIGSEL::Trig3,
4 => TRIGSEL::Trig4,
5 => TRIGSEL::Trig5,
6 => TRIGSEL::Trig6,
7 => TRIGSEL::Trig7,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_trig0(&self) -> bool {
*self == TRIGSEL::Trig0
}
#[inline(always)]
pub fn is_trig1(&self) -> bool {
*self == TRIGSEL::Trig1
}
#[inline(always)]
pub fn is_trig2(&self) -> bool {
*self == TRIGSEL::Trig2
}
#[inline(always)]
pub fn is_trig3(&self) -> bool {
*self == TRIGSEL::Trig3
}
#[inline(always)]
pub fn is_trig4(&self) -> bool {
*self == TRIGSEL::Trig4
}
#[inline(always)]
pub fn is_trig5(&self) -> bool {
*self == TRIGSEL::Trig5
}
#[inline(always)]
pub fn is_trig6(&self) -> bool {
*self == TRIGSEL::Trig6
}
#[inline(always)]
pub fn is_trig7(&self) -> bool {
*self == TRIGSEL::Trig7
}
}
pub type TRIGSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TRIGSEL, crate::Safe>;
impl<'a, REG> TRIGSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn trig0(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig0)
}
#[inline(always)]
pub fn trig1(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig1)
}
#[inline(always)]
pub fn trig2(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig2)
}
#[inline(always)]
pub fn trig3(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig3)
}
#[inline(always)]
pub fn trig4(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig4)
}
#[inline(always)]
pub fn trig5(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig5)
}
#[inline(always)]
pub fn trig6(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig6)
}
#[inline(always)]
pub fn trig7(self) -> &'a mut crate::W<REG> {
self.variant(TRIGSEL::Trig7)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TRIGEN {
Sw = 0,
RisingEdge = 1,
FallingEdge = 2,
BothEdges = 3,
}
impl From<TRIGEN> for u8 {
#[inline(always)]
fn from(variant: TRIGEN) -> Self {
variant as _
}
}
impl crate::FieldSpec for TRIGEN {
type Ux = u8;
}
impl crate::IsEnum for TRIGEN {}
pub type TRIGEN_R = crate::FieldReader<TRIGEN>;
impl TRIGEN_R {
#[inline(always)]
pub const fn variant(&self) -> TRIGEN {
match self.bits {
0 => TRIGEN::Sw,
1 => TRIGEN::RisingEdge,
2 => TRIGEN::FallingEdge,
3 => TRIGEN::BothEdges,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_sw(&self) -> bool {
*self == TRIGEN::Sw
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == TRIGEN::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == TRIGEN::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == TRIGEN::BothEdges
}
}
pub type TRIGEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2, TRIGEN, crate::Safe>;
impl<'a, REG> TRIGEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn sw(self) -> &'a mut crate::W<REG> {
self.variant(TRIGEN::Sw)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(TRIGEN::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(TRIGEN::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(TRIGEN::BothEdges)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIMOUT {
Disabled = 0,
Enabled = 1,
}
impl From<TIMOUT> for bool {
#[inline(always)]
fn from(variant: TIMOUT) -> Self {
variant as u8 != 0
}
}
pub type TIMOUT_R = crate::BitReader<TIMOUT>;
impl TIMOUT_R {
#[inline(always)]
pub const fn variant(&self) -> TIMOUT {
match self.bits {
false => TIMOUT::Disabled,
true => TIMOUT::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TIMOUT::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TIMOUT::Enabled
}
}
pub type TIMOUT_W<'a, REG> = crate::BitWriter<'a, REG, TIMOUT>;
impl<'a, REG> TIMOUT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TIMOUT::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TIMOUT::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WAVE {
Inactive = 0,
Active = 1,
}
impl From<WAVE> for bool {
#[inline(always)]
fn from(variant: WAVE) -> Self {
variant as u8 != 0
}
}
pub type WAVE_R = crate::BitReader<WAVE>;
impl WAVE_R {
#[inline(always)]
pub const fn variant(&self) -> WAVE {
match self.bits {
false => WAVE::Inactive,
true => WAVE::Active,
}
}
#[inline(always)]
pub fn is_inactive(&self) -> bool {
*self == WAVE::Inactive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == WAVE::Active
}
}
pub type WAVE_W<'a, REG> = crate::BitWriter<'a, REG, WAVE>;
impl<'a, REG> WAVE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn inactive(self) -> &'a mut crate::W<REG> {
self.variant(WAVE::Inactive)
}
#[inline(always)]
pub fn active(self) -> &'a mut crate::W<REG> {
self.variant(WAVE::Active)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WAVPOL {
Positive = 0,
Negative = 1,
}
impl From<WAVPOL> for bool {
#[inline(always)]
fn from(variant: WAVPOL) -> Self {
variant as u8 != 0
}
}
pub type WAVPOL_R = crate::BitReader<WAVPOL>;
impl WAVPOL_R {
#[inline(always)]
pub const fn variant(&self) -> WAVPOL {
match self.bits {
false => WAVPOL::Positive,
true => WAVPOL::Negative,
}
}
#[inline(always)]
pub fn is_positive(&self) -> bool {
*self == WAVPOL::Positive
}
#[inline(always)]
pub fn is_negative(&self) -> bool {
*self == WAVPOL::Negative
}
}
pub type WAVPOL_W<'a, REG> = crate::BitWriter<'a, REG, WAVPOL>;
impl<'a, REG> WAVPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn positive(self) -> &'a mut crate::W<REG> {
self.variant(WAVPOL::Positive)
}
#[inline(always)]
pub fn negative(self) -> &'a mut crate::W<REG> {
self.variant(WAVPOL::Negative)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PRELOAD {
Immediate = 0,
EndOfPeriod = 1,
}
impl From<PRELOAD> for bool {
#[inline(always)]
fn from(variant: PRELOAD) -> Self {
variant as u8 != 0
}
}
pub type PRELOAD_R = crate::BitReader<PRELOAD>;
impl PRELOAD_R {
#[inline(always)]
pub const fn variant(&self) -> PRELOAD {
match self.bits {
false => PRELOAD::Immediate,
true => PRELOAD::EndOfPeriod,
}
}
#[inline(always)]
pub fn is_immediate(&self) -> bool {
*self == PRELOAD::Immediate
}
#[inline(always)]
pub fn is_end_of_period(&self) -> bool {
*self == PRELOAD::EndOfPeriod
}
}
pub type PRELOAD_W<'a, REG> = crate::BitWriter<'a, REG, PRELOAD>;
impl<'a, REG> PRELOAD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn immediate(self) -> &'a mut crate::W<REG> {
self.variant(PRELOAD::Immediate)
}
#[inline(always)]
pub fn end_of_period(self) -> &'a mut crate::W<REG> {
self.variant(PRELOAD::EndOfPeriod)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum COUNTMODE {
Internal = 0,
External = 1,
}
impl From<COUNTMODE> for bool {
#[inline(always)]
fn from(variant: COUNTMODE) -> Self {
variant as u8 != 0
}
}
pub type COUNTMODE_R = crate::BitReader<COUNTMODE>;
impl COUNTMODE_R {
#[inline(always)]
pub const fn variant(&self) -> COUNTMODE {
match self.bits {
false => COUNTMODE::Internal,
true => COUNTMODE::External,
}
}
#[inline(always)]
pub fn is_internal(&self) -> bool {
*self == COUNTMODE::Internal
}
#[inline(always)]
pub fn is_external(&self) -> bool {
*self == COUNTMODE::External
}
}
pub type COUNTMODE_W<'a, REG> = crate::BitWriter<'a, REG, COUNTMODE>;
impl<'a, REG> COUNTMODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn internal(self) -> &'a mut crate::W<REG> {
self.variant(COUNTMODE::Internal)
}
#[inline(always)]
pub fn external(self) -> &'a mut crate::W<REG> {
self.variant(COUNTMODE::External)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ENC {
Disabled = 0,
Enabled = 1,
}
impl From<ENC> for bool {
#[inline(always)]
fn from(variant: ENC) -> Self {
variant as u8 != 0
}
}
pub type ENC_R = crate::BitReader<ENC>;
impl ENC_R {
#[inline(always)]
pub const fn variant(&self) -> ENC {
match self.bits {
false => ENC::Disabled,
true => ENC::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ENC::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ENC::Enabled
}
}
pub type ENC_W<'a, REG> = crate::BitWriter<'a, REG, ENC>;
impl<'a, REG> ENC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ENC::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ENC::Enabled)
}
}
impl R {
#[inline(always)]
pub fn cksel(&self) -> CKSEL_R {
CKSEL_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn ckpol(&self) -> CKPOL_R {
CKPOL_R::new(((self.bits >> 1) & 3) as u8)
}
#[inline(always)]
pub fn ckflt(&self) -> CKFLT_R {
CKFLT_R::new(((self.bits >> 3) & 3) as u8)
}
#[inline(always)]
pub fn trgflt(&self) -> TRGFLT_R {
TRGFLT_R::new(((self.bits >> 6) & 3) as u8)
}
#[inline(always)]
pub fn presc(&self) -> PRESC_R {
PRESC_R::new(((self.bits >> 9) & 7) as u8)
}
#[inline(always)]
pub fn trigsel(&self) -> TRIGSEL_R {
TRIGSEL_R::new(((self.bits >> 13) & 7) as u8)
}
#[inline(always)]
pub fn trigen(&self) -> TRIGEN_R {
TRIGEN_R::new(((self.bits >> 17) & 3) as u8)
}
#[inline(always)]
pub fn timout(&self) -> TIMOUT_R {
TIMOUT_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn wave(&self) -> WAVE_R {
WAVE_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn wavpol(&self) -> WAVPOL_R {
WAVPOL_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn preload(&self) -> PRELOAD_R {
PRELOAD_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn countmode(&self) -> COUNTMODE_R {
COUNTMODE_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn enc(&self) -> ENC_R {
ENC_R::new(((self.bits >> 24) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFGR")
.field("enc", &self.enc())
.field("countmode", &self.countmode())
.field("preload", &self.preload())
.field("wavpol", &self.wavpol())
.field("wave", &self.wave())
.field("timout", &self.timout())
.field("trigen", &self.trigen())
.field("trigsel", &self.trigsel())
.field("presc", &self.presc())
.field("trgflt", &self.trgflt())
.field("ckflt", &self.ckflt())
.field("ckpol", &self.ckpol())
.field("cksel", &self.cksel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn cksel(&mut self) -> CKSEL_W<CFGRrs> {
CKSEL_W::new(self, 0)
}
#[inline(always)]
pub fn ckpol(&mut self) -> CKPOL_W<CFGRrs> {
CKPOL_W::new(self, 1)
}
#[inline(always)]
pub fn ckflt(&mut self) -> CKFLT_W<CFGRrs> {
CKFLT_W::new(self, 3)
}
#[inline(always)]
pub fn trgflt(&mut self) -> TRGFLT_W<CFGRrs> {
TRGFLT_W::new(self, 6)
}
#[inline(always)]
pub fn presc(&mut self) -> PRESC_W<CFGRrs> {
PRESC_W::new(self, 9)
}
#[inline(always)]
pub fn trigsel(&mut self) -> TRIGSEL_W<CFGRrs> {
TRIGSEL_W::new(self, 13)
}
#[inline(always)]
pub fn trigen(&mut self) -> TRIGEN_W<CFGRrs> {
TRIGEN_W::new(self, 17)
}
#[inline(always)]
pub fn timout(&mut self) -> TIMOUT_W<CFGRrs> {
TIMOUT_W::new(self, 19)
}
#[inline(always)]
pub fn wave(&mut self) -> WAVE_W<CFGRrs> {
WAVE_W::new(self, 20)
}
#[inline(always)]
pub fn wavpol(&mut self) -> WAVPOL_W<CFGRrs> {
WAVPOL_W::new(self, 21)
}
#[inline(always)]
pub fn preload(&mut self) -> PRELOAD_W<CFGRrs> {
PRELOAD_W::new(self, 22)
}
#[inline(always)]
pub fn countmode(&mut self) -> COUNTMODE_W<CFGRrs> {
COUNTMODE_W::new(self, 23)
}
#[inline(always)]
pub fn enc(&mut self) -> ENC_W<CFGRrs> {
ENC_W::new(self, 24)
}
}
pub struct CFGRrs;
impl crate::RegisterSpec for CFGRrs {
type Ux = u32;
}
impl crate::Readable for CFGRrs {}
impl crate::Writable for CFGRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CFGRrs {}