pub type R = crate::R<CRrs>;
pub type W = crate::W<CRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum WUCKSEL {
Div16 = 0,
Div8 = 1,
Div4 = 2,
Div2 = 3,
ClockSpare = 4,
ClockSpareWithOffset = 6,
}
impl From<WUCKSEL> for u8 {
#[inline(always)]
fn from(variant: WUCKSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for WUCKSEL {
type Ux = u8;
}
impl crate::IsEnum for WUCKSEL {}
pub type WUCKSEL_R = crate::FieldReader<WUCKSEL>;
impl WUCKSEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<WUCKSEL> {
match self.bits {
0 => Some(WUCKSEL::Div16),
1 => Some(WUCKSEL::Div8),
2 => Some(WUCKSEL::Div4),
3 => Some(WUCKSEL::Div2),
4 => Some(WUCKSEL::ClockSpare),
6 => Some(WUCKSEL::ClockSpareWithOffset),
_ => None,
}
}
#[inline(always)]
pub fn is_div16(&self) -> bool {
*self == WUCKSEL::Div16
}
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == WUCKSEL::Div8
}
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == WUCKSEL::Div4
}
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == WUCKSEL::Div2
}
#[inline(always)]
pub fn is_clock_spare(&self) -> bool {
*self == WUCKSEL::ClockSpare
}
#[inline(always)]
pub fn is_clock_spare_with_offset(&self) -> bool {
*self == WUCKSEL::ClockSpareWithOffset
}
}
pub type WUCKSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, WUCKSEL>;
impl<'a, REG> WUCKSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn div16(self) -> &'a mut crate::W<REG> {
self.variant(WUCKSEL::Div16)
}
#[inline(always)]
pub fn div8(self) -> &'a mut crate::W<REG> {
self.variant(WUCKSEL::Div8)
}
#[inline(always)]
pub fn div4(self) -> &'a mut crate::W<REG> {
self.variant(WUCKSEL::Div4)
}
#[inline(always)]
pub fn div2(self) -> &'a mut crate::W<REG> {
self.variant(WUCKSEL::Div2)
}
#[inline(always)]
pub fn clock_spare(self) -> &'a mut crate::W<REG> {
self.variant(WUCKSEL::ClockSpare)
}
#[inline(always)]
pub fn clock_spare_with_offset(self) -> &'a mut crate::W<REG> {
self.variant(WUCKSEL::ClockSpareWithOffset)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSEDGE {
RisingEdge = 0,
FallingEdge = 1,
}
impl From<TSEDGE> for bool {
#[inline(always)]
fn from(variant: TSEDGE) -> Self {
variant as u8 != 0
}
}
pub type TSEDGE_R = crate::BitReader<TSEDGE>;
impl TSEDGE_R {
#[inline(always)]
pub const fn variant(&self) -> TSEDGE {
match self.bits {
false => TSEDGE::RisingEdge,
true => TSEDGE::FallingEdge,
}
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == TSEDGE::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == TSEDGE::FallingEdge
}
}
pub type TSEDGE_W<'a, REG> = crate::BitWriter<'a, REG, TSEDGE>;
impl<'a, REG> TSEDGE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(TSEDGE::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(TSEDGE::FallingEdge)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum REFCKON {
Disabled = 0,
Enabled = 1,
}
impl From<REFCKON> for bool {
#[inline(always)]
fn from(variant: REFCKON) -> Self {
variant as u8 != 0
}
}
pub type REFCKON_R = crate::BitReader<REFCKON>;
impl REFCKON_R {
#[inline(always)]
pub const fn variant(&self) -> REFCKON {
match self.bits {
false => REFCKON::Disabled,
true => REFCKON::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == REFCKON::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REFCKON::Enabled
}
}
pub type REFCKON_W<'a, REG> = crate::BitWriter<'a, REG, REFCKON>;
impl<'a, REG> REFCKON_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(REFCKON::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(REFCKON::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BYPSHAD {
ShadowReg = 0,
BypassShadowReg = 1,
}
impl From<BYPSHAD> for bool {
#[inline(always)]
fn from(variant: BYPSHAD) -> Self {
variant as u8 != 0
}
}
pub type BYPSHAD_R = crate::BitReader<BYPSHAD>;
impl BYPSHAD_R {
#[inline(always)]
pub const fn variant(&self) -> BYPSHAD {
match self.bits {
false => BYPSHAD::ShadowReg,
true => BYPSHAD::BypassShadowReg,
}
}
#[inline(always)]
pub fn is_shadow_reg(&self) -> bool {
*self == BYPSHAD::ShadowReg
}
#[inline(always)]
pub fn is_bypass_shadow_reg(&self) -> bool {
*self == BYPSHAD::BypassShadowReg
}
}
pub type BYPSHAD_W<'a, REG> = crate::BitWriter<'a, REG, BYPSHAD>;
impl<'a, REG> BYPSHAD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn shadow_reg(self) -> &'a mut crate::W<REG> {
self.variant(BYPSHAD::ShadowReg)
}
#[inline(always)]
pub fn bypass_shadow_reg(self) -> &'a mut crate::W<REG> {
self.variant(BYPSHAD::BypassShadowReg)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FMT {
TwentyFourHour = 0,
AmPm = 1,
}
impl From<FMT> for bool {
#[inline(always)]
fn from(variant: FMT) -> Self {
variant as u8 != 0
}
}
pub type FMT_R = crate::BitReader<FMT>;
impl FMT_R {
#[inline(always)]
pub const fn variant(&self) -> FMT {
match self.bits {
false => FMT::TwentyFourHour,
true => FMT::AmPm,
}
}
#[inline(always)]
pub fn is_twenty_four_hour(&self) -> bool {
*self == FMT::TwentyFourHour
}
#[inline(always)]
pub fn is_am_pm(&self) -> bool {
*self == FMT::AmPm
}
}
pub type FMT_W<'a, REG> = crate::BitWriter<'a, REG, FMT>;
impl<'a, REG> FMT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn twenty_four_hour(self) -> &'a mut crate::W<REG> {
self.variant(FMT::TwentyFourHour)
}
#[inline(always)]
pub fn am_pm(self) -> &'a mut crate::W<REG> {
self.variant(FMT::AmPm)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALRAE {
Disabled = 0,
Enabled = 1,
}
impl From<ALRAE> for bool {
#[inline(always)]
fn from(variant: ALRAE) -> Self {
variant as u8 != 0
}
}
pub type ALRE_R = crate::BitReader<ALRAE>;
impl ALRE_R {
#[inline(always)]
pub const fn variant(&self) -> ALRAE {
match self.bits {
false => ALRAE::Disabled,
true => ALRAE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALRAE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALRAE::Enabled
}
}
pub type ALRE_W<'a, REG> = crate::BitWriter<'a, REG, ALRAE>;
impl<'a, REG> ALRE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ALRAE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ALRAE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUTE {
Disabled = 0,
Enabled = 1,
}
impl From<WUTE> for bool {
#[inline(always)]
fn from(variant: WUTE) -> Self {
variant as u8 != 0
}
}
pub type WUTE_R = crate::BitReader<WUTE>;
impl WUTE_R {
#[inline(always)]
pub const fn variant(&self) -> WUTE {
match self.bits {
false => WUTE::Disabled,
true => WUTE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WUTE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WUTE::Enabled
}
}
pub type WUTE_W<'a, REG> = crate::BitWriter<'a, REG, WUTE>;
impl<'a, REG> WUTE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WUTE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WUTE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSE {
Disabled = 0,
Enabled = 1,
}
impl From<TSE> for bool {
#[inline(always)]
fn from(variant: TSE) -> Self {
variant as u8 != 0
}
}
pub type TSE_R = crate::BitReader<TSE>;
impl TSE_R {
#[inline(always)]
pub const fn variant(&self) -> TSE {
match self.bits {
false => TSE::Disabled,
true => TSE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TSE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TSE::Enabled
}
}
pub type TSE_W<'a, REG> = crate::BitWriter<'a, REG, TSE>;
impl<'a, REG> TSE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TSE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TSE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALRAIE {
Disabled = 0,
Enabled = 1,
}
impl From<ALRAIE> for bool {
#[inline(always)]
fn from(variant: ALRAIE) -> Self {
variant as u8 != 0
}
}
pub type ALRIE_R = crate::BitReader<ALRAIE>;
impl ALRIE_R {
#[inline(always)]
pub const fn variant(&self) -> ALRAIE {
match self.bits {
false => ALRAIE::Disabled,
true => ALRAIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALRAIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALRAIE::Enabled
}
}
pub type ALRIE_W<'a, REG> = crate::BitWriter<'a, REG, ALRAIE>;
impl<'a, REG> ALRIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ALRAIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ALRAIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUTIE {
Disabled = 0,
Enabled = 1,
}
impl From<WUTIE> for bool {
#[inline(always)]
fn from(variant: WUTIE) -> Self {
variant as u8 != 0
}
}
pub type WUTIE_R = crate::BitReader<WUTIE>;
impl WUTIE_R {
#[inline(always)]
pub const fn variant(&self) -> WUTIE {
match self.bits {
false => WUTIE::Disabled,
true => WUTIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WUTIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WUTIE::Enabled
}
}
pub type WUTIE_W<'a, REG> = crate::BitWriter<'a, REG, WUTIE>;
impl<'a, REG> WUTIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WUTIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WUTIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSIE {
Disabled = 0,
Enabled = 1,
}
impl From<TSIE> for bool {
#[inline(always)]
fn from(variant: TSIE) -> Self {
variant as u8 != 0
}
}
pub type TSIE_R = crate::BitReader<TSIE>;
impl TSIE_R {
#[inline(always)]
pub const fn variant(&self) -> TSIE {
match self.bits {
false => TSIE::Disabled,
true => TSIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TSIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TSIE::Enabled
}
}
pub type TSIE_W<'a, REG> = crate::BitWriter<'a, REG, TSIE>;
impl<'a, REG> TSIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TSIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TSIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADD1HW {
Add1 = 1,
}
impl From<ADD1HW> for bool {
#[inline(always)]
fn from(variant: ADD1HW) -> Self {
variant as u8 != 0
}
}
pub type ADD1H_R = crate::BitReader<ADD1HW>;
impl ADD1H_R {
#[inline(always)]
pub const fn variant(&self) -> Option<ADD1HW> {
match self.bits {
true => Some(ADD1HW::Add1),
_ => None,
}
}
#[inline(always)]
pub fn is_add1(&self) -> bool {
*self == ADD1HW::Add1
}
}
pub type ADD1H_W<'a, REG> = crate::BitWriter<'a, REG, ADD1HW>;
impl<'a, REG> ADD1H_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn add1(self) -> &'a mut crate::W<REG> {
self.variant(ADD1HW::Add1)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SUB1HW {
Sub1 = 1,
}
impl From<SUB1HW> for bool {
#[inline(always)]
fn from(variant: SUB1HW) -> Self {
variant as u8 != 0
}
}
pub type SUB1H_R = crate::BitReader<SUB1HW>;
impl SUB1H_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SUB1HW> {
match self.bits {
true => Some(SUB1HW::Sub1),
_ => None,
}
}
#[inline(always)]
pub fn is_sub1(&self) -> bool {
*self == SUB1HW::Sub1
}
}
pub type SUB1H_W<'a, REG> = crate::BitWriter<'a, REG, SUB1HW>;
impl<'a, REG> SUB1H_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn sub1(self) -> &'a mut crate::W<REG> {
self.variant(SUB1HW::Sub1)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BKP {
DstNotChanged = 0,
DstChanged = 1,
}
impl From<BKP> for bool {
#[inline(always)]
fn from(variant: BKP) -> Self {
variant as u8 != 0
}
}
pub type BKP_R = crate::BitReader<BKP>;
impl BKP_R {
#[inline(always)]
pub const fn variant(&self) -> BKP {
match self.bits {
false => BKP::DstNotChanged,
true => BKP::DstChanged,
}
}
#[inline(always)]
pub fn is_dst_not_changed(&self) -> bool {
*self == BKP::DstNotChanged
}
#[inline(always)]
pub fn is_dst_changed(&self) -> bool {
*self == BKP::DstChanged
}
}
pub type BKP_W<'a, REG> = crate::BitWriter<'a, REG, BKP>;
impl<'a, REG> BKP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn dst_not_changed(self) -> &'a mut crate::W<REG> {
self.variant(BKP::DstNotChanged)
}
#[inline(always)]
pub fn dst_changed(self) -> &'a mut crate::W<REG> {
self.variant(BKP::DstChanged)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum COSEL {
CalFreq512hz = 0,
CalFreq1hz = 1,
}
impl From<COSEL> for bool {
#[inline(always)]
fn from(variant: COSEL) -> Self {
variant as u8 != 0
}
}
pub type COSEL_R = crate::BitReader<COSEL>;
impl COSEL_R {
#[inline(always)]
pub const fn variant(&self) -> COSEL {
match self.bits {
false => COSEL::CalFreq512hz,
true => COSEL::CalFreq1hz,
}
}
#[inline(always)]
pub fn is_cal_freq_512hz(&self) -> bool {
*self == COSEL::CalFreq512hz
}
#[inline(always)]
pub fn is_cal_freq_1hz(&self) -> bool {
*self == COSEL::CalFreq1hz
}
}
pub type COSEL_W<'a, REG> = crate::BitWriter<'a, REG, COSEL>;
impl<'a, REG> COSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn cal_freq_512hz(self) -> &'a mut crate::W<REG> {
self.variant(COSEL::CalFreq512hz)
}
#[inline(always)]
pub fn cal_freq_1hz(self) -> &'a mut crate::W<REG> {
self.variant(COSEL::CalFreq1hz)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum POL {
High = 0,
Low = 1,
}
impl From<POL> for bool {
#[inline(always)]
fn from(variant: POL) -> Self {
variant as u8 != 0
}
}
pub type POL_R = crate::BitReader<POL>;
impl POL_R {
#[inline(always)]
pub const fn variant(&self) -> POL {
match self.bits {
false => POL::High,
true => POL::Low,
}
}
#[inline(always)]
pub fn is_high(&self) -> bool {
*self == POL::High
}
#[inline(always)]
pub fn is_low(&self) -> bool {
*self == POL::Low
}
}
pub type POL_W<'a, REG> = crate::BitWriter<'a, REG, POL>;
impl<'a, REG> POL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn high(self) -> &'a mut crate::W<REG> {
self.variant(POL::High)
}
#[inline(always)]
pub fn low(self) -> &'a mut crate::W<REG> {
self.variant(POL::Low)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum OSEL {
Disabled = 0,
AlarmA = 1,
AlarmB = 2,
Wakeup = 3,
}
impl From<OSEL> for u8 {
#[inline(always)]
fn from(variant: OSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for OSEL {
type Ux = u8;
}
impl crate::IsEnum for OSEL {}
pub type OSEL_R = crate::FieldReader<OSEL>;
impl OSEL_R {
#[inline(always)]
pub const fn variant(&self) -> OSEL {
match self.bits {
0 => OSEL::Disabled,
1 => OSEL::AlarmA,
2 => OSEL::AlarmB,
3 => OSEL::Wakeup,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == OSEL::Disabled
}
#[inline(always)]
pub fn is_alarm_a(&self) -> bool {
*self == OSEL::AlarmA
}
#[inline(always)]
pub fn is_alarm_b(&self) -> bool {
*self == OSEL::AlarmB
}
#[inline(always)]
pub fn is_wakeup(&self) -> bool {
*self == OSEL::Wakeup
}
}
pub type OSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, OSEL, crate::Safe>;
impl<'a, REG> OSEL_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(OSEL::Disabled)
}
#[inline(always)]
pub fn alarm_a(self) -> &'a mut crate::W<REG> {
self.variant(OSEL::AlarmA)
}
#[inline(always)]
pub fn alarm_b(self) -> &'a mut crate::W<REG> {
self.variant(OSEL::AlarmB)
}
#[inline(always)]
pub fn wakeup(self) -> &'a mut crate::W<REG> {
self.variant(OSEL::Wakeup)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum COE {
Disabled = 0,
Enabled = 1,
}
impl From<COE> for bool {
#[inline(always)]
fn from(variant: COE) -> Self {
variant as u8 != 0
}
}
pub type COE_R = crate::BitReader<COE>;
impl COE_R {
#[inline(always)]
pub const fn variant(&self) -> COE {
match self.bits {
false => COE::Disabled,
true => COE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == COE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == COE::Enabled
}
}
pub type COE_W<'a, REG> = crate::BitWriter<'a, REG, COE>;
impl<'a, REG> COE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(COE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(COE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn wucksel(&self) -> WUCKSEL_R {
WUCKSEL_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn tsedge(&self) -> TSEDGE_R {
TSEDGE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn refckon(&self) -> REFCKON_R {
REFCKON_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn bypshad(&self) -> BYPSHAD_R {
BYPSHAD_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn fmt(&self) -> FMT_R {
FMT_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn alre(&self, n: u8) -> ALRE_R {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
ALRE_R::new(((self.bits >> (n + 8)) & 1) != 0)
}
#[inline(always)]
pub fn alre_iter(&self) -> impl Iterator<Item = ALRE_R> + '_ {
(0..2).map(move |n| ALRE_R::new(((self.bits >> (n + 8)) & 1) != 0))
}
#[inline(always)]
pub fn alrae(&self) -> ALRE_R {
ALRE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn alrbe(&self) -> ALRE_R {
ALRE_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn wute(&self) -> WUTE_R {
WUTE_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn tse(&self) -> TSE_R {
TSE_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn alrie(&self, n: u8) -> ALRIE_R {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
ALRIE_R::new(((self.bits >> (n + 12)) & 1) != 0)
}
#[inline(always)]
pub fn alrie_iter(&self) -> impl Iterator<Item = ALRIE_R> + '_ {
(0..2).map(move |n| ALRIE_R::new(((self.bits >> (n + 12)) & 1) != 0))
}
#[inline(always)]
pub fn alraie(&self) -> ALRIE_R {
ALRIE_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn alrbie(&self) -> ALRIE_R {
ALRIE_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn wutie(&self) -> WUTIE_R {
WUTIE_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn tsie(&self) -> TSIE_R {
TSIE_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn add1h(&self) -> ADD1H_R {
ADD1H_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn sub1h(&self) -> SUB1H_R {
SUB1H_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn bkp(&self) -> BKP_R {
BKP_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn cosel(&self) -> COSEL_R {
COSEL_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn pol(&self) -> POL_R {
POL_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn osel(&self) -> OSEL_R {
OSEL_R::new(((self.bits >> 21) & 3) as u8)
}
#[inline(always)]
pub fn coe(&self) -> COE_R {
COE_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("CR")
.field("wucksel", &self.wucksel())
.field("tsedge", &self.tsedge())
.field("refckon", &self.refckon())
.field("bypshad", &self.bypshad())
.field("fmt", &self.fmt())
.field("alrae", &self.alrae())
.field("alrbe", &self.alrbe())
.field("wute", &self.wute())
.field("tse", &self.tse())
.field("alraie", &self.alraie())
.field("alrbie", &self.alrbie())
.field("wutie", &self.wutie())
.field("tsie", &self.tsie())
.field("add1h", &self.add1h())
.field("sub1h", &self.sub1h())
.field("bkp", &self.bkp())
.field("cosel", &self.cosel())
.field("pol", &self.pol())
.field("osel", &self.osel())
.field("coe", &self.coe())
.finish()
}
}
impl W {
#[inline(always)]
pub fn wucksel(&mut self) -> WUCKSEL_W<CRrs> {
WUCKSEL_W::new(self, 0)
}
#[inline(always)]
pub fn tsedge(&mut self) -> TSEDGE_W<CRrs> {
TSEDGE_W::new(self, 3)
}
#[inline(always)]
pub fn refckon(&mut self) -> REFCKON_W<CRrs> {
REFCKON_W::new(self, 4)
}
#[inline(always)]
pub fn bypshad(&mut self) -> BYPSHAD_W<CRrs> {
BYPSHAD_W::new(self, 5)
}
#[inline(always)]
pub fn fmt(&mut self) -> FMT_W<CRrs> {
FMT_W::new(self, 6)
}
#[inline(always)]
pub fn alre(&mut self, n: u8) -> ALRE_W<CRrs> {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
ALRE_W::new(self, n + 8)
}
#[inline(always)]
pub fn alrae(&mut self) -> ALRE_W<CRrs> {
ALRE_W::new(self, 8)
}
#[inline(always)]
pub fn alrbe(&mut self) -> ALRE_W<CRrs> {
ALRE_W::new(self, 9)
}
#[inline(always)]
pub fn wute(&mut self) -> WUTE_W<CRrs> {
WUTE_W::new(self, 10)
}
#[inline(always)]
pub fn tse(&mut self) -> TSE_W<CRrs> {
TSE_W::new(self, 11)
}
#[inline(always)]
pub fn alrie(&mut self, n: u8) -> ALRIE_W<CRrs> {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
ALRIE_W::new(self, n + 12)
}
#[inline(always)]
pub fn alraie(&mut self) -> ALRIE_W<CRrs> {
ALRIE_W::new(self, 12)
}
#[inline(always)]
pub fn alrbie(&mut self) -> ALRIE_W<CRrs> {
ALRIE_W::new(self, 13)
}
#[inline(always)]
pub fn wutie(&mut self) -> WUTIE_W<CRrs> {
WUTIE_W::new(self, 14)
}
#[inline(always)]
pub fn tsie(&mut self) -> TSIE_W<CRrs> {
TSIE_W::new(self, 15)
}
#[inline(always)]
pub fn add1h(&mut self) -> ADD1H_W<CRrs> {
ADD1H_W::new(self, 16)
}
#[inline(always)]
pub fn sub1h(&mut self) -> SUB1H_W<CRrs> {
SUB1H_W::new(self, 17)
}
#[inline(always)]
pub fn bkp(&mut self) -> BKP_W<CRrs> {
BKP_W::new(self, 18)
}
#[inline(always)]
pub fn cosel(&mut self) -> COSEL_W<CRrs> {
COSEL_W::new(self, 19)
}
#[inline(always)]
pub fn pol(&mut self) -> POL_W<CRrs> {
POL_W::new(self, 20)
}
#[inline(always)]
pub fn osel(&mut self) -> OSEL_W<CRrs> {
OSEL_W::new(self, 21)
}
#[inline(always)]
pub fn coe(&mut self) -> COE_W<CRrs> {
COE_W::new(self, 23)
}
}
pub struct CRrs;
impl crate::RegisterSpec for CRrs {
type Ux = u32;
}
impl crate::Readable for CRrs {}
impl crate::Writable for CRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CRrs {}