#[doc = "Register `RFCSEL9` reader"]
pub type R = crate::R<Rfcsel9Spec>;
#[doc = "Register `RFCSEL9` writer"]
pub type W = crate::W<Rfcsel9Spec>;
#[doc = "6:0\\]
Read/write selection value Writing any other value than values defined by a ENUM may result in undefined behavior.\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Ev {
#[doc = "121: Always asserted"]
AlwaysActive = 121,
#[doc = "115: AUX ADC interrupt event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_IRQ. Status flags are found here AUX_EVCTL:EVTOMCUFLAGS"]
AuxAdcIrq = 115,
#[doc = "114: Loopback of OBSMUX0 through AUX, corresponds to AUX_EVCTL:EVTOMCUFLAGS.OBSMUX0"]
AuxObsmux0 = 114,
#[doc = "113: AUX ADC FIFO watermark event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_FIFO_ALMOST_FULL"]
AuxAdcFifoAlmostFull = 113,
#[doc = "112: AUX ADC done, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_DONE"]
AuxAdcDone = 112,
#[doc = "111: Autotake event from AUX semaphore, configured by AUX_SMPH:AUTOTAKE"]
AuxSmphAutotakeDone = 111,
#[doc = "110: AUX timer 1 event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.TIMER1_EV"]
AuxTimer1Ev = 110,
#[doc = "109: AUX timer 0 event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.TIMER0_EV"]
AuxTimer0Ev = 109,
#[doc = "108: AUX TDC measurement done event, corresponds to the flag AUX_EVCTL:EVTOMCUFLAGS.TDC_DONE and the AUX_TDC status AUX_TDC:STAT.DONE"]
AuxTdcDone = 108,
#[doc = "107: AUX Compare B event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.AUX_COMPB"]
AuxCompb = 107,
#[doc = "106: AUX Compare A event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.AUX_COMPA"]
AuxCompa = 106,
#[doc = "105: AON wakeup event, corresponds flags are here AUX_EVCTL:EVTOMCUFLAGS.AON_WU_EV"]
AuxAonWuEv = 105,
#[doc = "101: Software event 1, triggered by SWEV.SWEV1"]
Swev1 = 101,
#[doc = "100: Software event 0, triggered by SWEV.SWEV0"]
Swev0 = 100,
#[doc = "93: CRYPTO result available interupt event, the corresponding flag is found here CRYPTO:IRQSTAT.RESULT_AVAIL. Controlled by CRYPTO:IRQSTAT.RESULT_AVAIL"]
CryptoResultAvailIrq = 93,
#[doc = "39: Combined DMA done, corresponding flags are here UDMA0:REQDONE"]
DmaDoneComb = 39,
#[doc = "36: UART0 combined interrupt, interrupt flags are found here UART0:MIS"]
Uart0Comb = 36,
#[doc = "35: SSI1 combined interrupt, interrupt flags are found here SSI1:MIS"]
Ssi1Comb = 35,
#[doc = "34: SSI0 combined interrupt, interrupt flags are found here SSI0:MIS"]
Ssi0Comb = 34,
#[doc = "24: Watchdog interrupt event, controlled by WDT:CTL.INTEN"]
WdtIrq = 24,
#[doc = "10: AUX Software event 0, AUX_EVCTL:SWEVSET.SWEV0"]
AonAuxSwev0 = 10,
#[doc = "8: Interrupt event from I2S"]
I2sIrq = 8,
#[doc = "2: AON programmable event 1. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL.AON_PROG1_EV"]
AonProg1 = 2,
#[doc = "1: AON programmable event 0. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL.AON_PROG0_EV"]
AonProg0 = 1,
#[doc = "0: Always inactive"]
None = 0,
}
impl From<Ev> for u8 {
#[inline(always)]
fn from(variant: Ev) -> Self {
variant as _
}
}
impl crate::FieldSpec for Ev {
type Ux = u8;
}
impl crate::IsEnum for Ev {}
#[doc = "Field `EV` reader - 6:0\\]
Read/write selection value Writing any other value than values defined by a ENUM may result in undefined behavior."]
pub type EvR = crate::FieldReader<Ev>;
impl EvR {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> Option<Ev> {
match self.bits {
121 => Some(Ev::AlwaysActive),
115 => Some(Ev::AuxAdcIrq),
114 => Some(Ev::AuxObsmux0),
113 => Some(Ev::AuxAdcFifoAlmostFull),
112 => Some(Ev::AuxAdcDone),
111 => Some(Ev::AuxSmphAutotakeDone),
110 => Some(Ev::AuxTimer1Ev),
109 => Some(Ev::AuxTimer0Ev),
108 => Some(Ev::AuxTdcDone),
107 => Some(Ev::AuxCompb),
106 => Some(Ev::AuxCompa),
105 => Some(Ev::AuxAonWuEv),
101 => Some(Ev::Swev1),
100 => Some(Ev::Swev0),
93 => Some(Ev::CryptoResultAvailIrq),
39 => Some(Ev::DmaDoneComb),
36 => Some(Ev::Uart0Comb),
35 => Some(Ev::Ssi1Comb),
34 => Some(Ev::Ssi0Comb),
24 => Some(Ev::WdtIrq),
10 => Some(Ev::AonAuxSwev0),
8 => Some(Ev::I2sIrq),
2 => Some(Ev::AonProg1),
1 => Some(Ev::AonProg0),
0 => Some(Ev::None),
_ => None,
}
}
#[doc = "Always asserted"]
#[inline(always)]
pub fn is_always_active(&self) -> bool {
*self == Ev::AlwaysActive
}
#[doc = "AUX ADC interrupt event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_IRQ. Status flags are found here AUX_EVCTL:EVTOMCUFLAGS"]
#[inline(always)]
pub fn is_aux_adc_irq(&self) -> bool {
*self == Ev::AuxAdcIrq
}
#[doc = "Loopback of OBSMUX0 through AUX, corresponds to AUX_EVCTL:EVTOMCUFLAGS.OBSMUX0"]
#[inline(always)]
pub fn is_aux_obsmux0(&self) -> bool {
*self == Ev::AuxObsmux0
}
#[doc = "AUX ADC FIFO watermark event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_FIFO_ALMOST_FULL"]
#[inline(always)]
pub fn is_aux_adc_fifo_almost_full(&self) -> bool {
*self == Ev::AuxAdcFifoAlmostFull
}
#[doc = "AUX ADC done, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_DONE"]
#[inline(always)]
pub fn is_aux_adc_done(&self) -> bool {
*self == Ev::AuxAdcDone
}
#[doc = "Autotake event from AUX semaphore, configured by AUX_SMPH:AUTOTAKE"]
#[inline(always)]
pub fn is_aux_smph_autotake_done(&self) -> bool {
*self == Ev::AuxSmphAutotakeDone
}
#[doc = "AUX timer 1 event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.TIMER1_EV"]
#[inline(always)]
pub fn is_aux_timer1_ev(&self) -> bool {
*self == Ev::AuxTimer1Ev
}
#[doc = "AUX timer 0 event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.TIMER0_EV"]
#[inline(always)]
pub fn is_aux_timer0_ev(&self) -> bool {
*self == Ev::AuxTimer0Ev
}
#[doc = "AUX TDC measurement done event, corresponds to the flag AUX_EVCTL:EVTOMCUFLAGS.TDC_DONE and the AUX_TDC status AUX_TDC:STAT.DONE"]
#[inline(always)]
pub fn is_aux_tdc_done(&self) -> bool {
*self == Ev::AuxTdcDone
}
#[doc = "AUX Compare B event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.AUX_COMPB"]
#[inline(always)]
pub fn is_aux_compb(&self) -> bool {
*self == Ev::AuxCompb
}
#[doc = "AUX Compare A event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.AUX_COMPA"]
#[inline(always)]
pub fn is_aux_compa(&self) -> bool {
*self == Ev::AuxCompa
}
#[doc = "AON wakeup event, corresponds flags are here AUX_EVCTL:EVTOMCUFLAGS.AON_WU_EV"]
#[inline(always)]
pub fn is_aux_aon_wu_ev(&self) -> bool {
*self == Ev::AuxAonWuEv
}
#[doc = "Software event 1, triggered by SWEV.SWEV1"]
#[inline(always)]
pub fn is_swev1(&self) -> bool {
*self == Ev::Swev1
}
#[doc = "Software event 0, triggered by SWEV.SWEV0"]
#[inline(always)]
pub fn is_swev0(&self) -> bool {
*self == Ev::Swev0
}
#[doc = "CRYPTO result available interupt event, the corresponding flag is found here CRYPTO:IRQSTAT.RESULT_AVAIL. Controlled by CRYPTO:IRQSTAT.RESULT_AVAIL"]
#[inline(always)]
pub fn is_crypto_result_avail_irq(&self) -> bool {
*self == Ev::CryptoResultAvailIrq
}
#[doc = "Combined DMA done, corresponding flags are here UDMA0:REQDONE"]
#[inline(always)]
pub fn is_dma_done_comb(&self) -> bool {
*self == Ev::DmaDoneComb
}
#[doc = "UART0 combined interrupt, interrupt flags are found here UART0:MIS"]
#[inline(always)]
pub fn is_uart0_comb(&self) -> bool {
*self == Ev::Uart0Comb
}
#[doc = "SSI1 combined interrupt, interrupt flags are found here SSI1:MIS"]
#[inline(always)]
pub fn is_ssi1_comb(&self) -> bool {
*self == Ev::Ssi1Comb
}
#[doc = "SSI0 combined interrupt, interrupt flags are found here SSI0:MIS"]
#[inline(always)]
pub fn is_ssi0_comb(&self) -> bool {
*self == Ev::Ssi0Comb
}
#[doc = "Watchdog interrupt event, controlled by WDT:CTL.INTEN"]
#[inline(always)]
pub fn is_wdt_irq(&self) -> bool {
*self == Ev::WdtIrq
}
#[doc = "AUX Software event 0, AUX_EVCTL:SWEVSET.SWEV0"]
#[inline(always)]
pub fn is_aon_aux_swev0(&self) -> bool {
*self == Ev::AonAuxSwev0
}
#[doc = "Interrupt event from I2S"]
#[inline(always)]
pub fn is_i2s_irq(&self) -> bool {
*self == Ev::I2sIrq
}
#[doc = "AON programmable event 1. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL.AON_PROG1_EV"]
#[inline(always)]
pub fn is_aon_prog1(&self) -> bool {
*self == Ev::AonProg1
}
#[doc = "AON programmable event 0. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL.AON_PROG0_EV"]
#[inline(always)]
pub fn is_aon_prog0(&self) -> bool {
*self == Ev::AonProg0
}
#[doc = "Always inactive"]
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == Ev::None
}
}
#[doc = "Field `EV` writer - 6:0\\]
Read/write selection value Writing any other value than values defined by a ENUM may result in undefined behavior."]
pub type EvW<'a, REG> = crate::FieldWriter<'a, REG, 7, Ev>;
impl<'a, REG> EvW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[doc = "Always asserted"]
#[inline(always)]
pub fn always_active(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AlwaysActive)
}
#[doc = "AUX ADC interrupt event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_IRQ. Status flags are found here AUX_EVCTL:EVTOMCUFLAGS"]
#[inline(always)]
pub fn aux_adc_irq(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxAdcIrq)
}
#[doc = "Loopback of OBSMUX0 through AUX, corresponds to AUX_EVCTL:EVTOMCUFLAGS.OBSMUX0"]
#[inline(always)]
pub fn aux_obsmux0(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxObsmux0)
}
#[doc = "AUX ADC FIFO watermark event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_FIFO_ALMOST_FULL"]
#[inline(always)]
pub fn aux_adc_fifo_almost_full(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxAdcFifoAlmostFull)
}
#[doc = "AUX ADC done, corresponds to AUX_EVCTL:EVTOMCUFLAGS.ADC_DONE"]
#[inline(always)]
pub fn aux_adc_done(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxAdcDone)
}
#[doc = "Autotake event from AUX semaphore, configured by AUX_SMPH:AUTOTAKE"]
#[inline(always)]
pub fn aux_smph_autotake_done(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxSmphAutotakeDone)
}
#[doc = "AUX timer 1 event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.TIMER1_EV"]
#[inline(always)]
pub fn aux_timer1_ev(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxTimer1Ev)
}
#[doc = "AUX timer 0 event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.TIMER0_EV"]
#[inline(always)]
pub fn aux_timer0_ev(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxTimer0Ev)
}
#[doc = "AUX TDC measurement done event, corresponds to the flag AUX_EVCTL:EVTOMCUFLAGS.TDC_DONE and the AUX_TDC status AUX_TDC:STAT.DONE"]
#[inline(always)]
pub fn aux_tdc_done(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxTdcDone)
}
#[doc = "AUX Compare B event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.AUX_COMPB"]
#[inline(always)]
pub fn aux_compb(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxCompb)
}
#[doc = "AUX Compare A event, corresponds to AUX_EVCTL:EVTOMCUFLAGS.AUX_COMPA"]
#[inline(always)]
pub fn aux_compa(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxCompa)
}
#[doc = "AON wakeup event, corresponds flags are here AUX_EVCTL:EVTOMCUFLAGS.AON_WU_EV"]
#[inline(always)]
pub fn aux_aon_wu_ev(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AuxAonWuEv)
}
#[doc = "Software event 1, triggered by SWEV.SWEV1"]
#[inline(always)]
pub fn swev1(self) -> &'a mut crate::W<REG> {
self.variant(Ev::Swev1)
}
#[doc = "Software event 0, triggered by SWEV.SWEV0"]
#[inline(always)]
pub fn swev0(self) -> &'a mut crate::W<REG> {
self.variant(Ev::Swev0)
}
#[doc = "CRYPTO result available interupt event, the corresponding flag is found here CRYPTO:IRQSTAT.RESULT_AVAIL. Controlled by CRYPTO:IRQSTAT.RESULT_AVAIL"]
#[inline(always)]
pub fn crypto_result_avail_irq(self) -> &'a mut crate::W<REG> {
self.variant(Ev::CryptoResultAvailIrq)
}
#[doc = "Combined DMA done, corresponding flags are here UDMA0:REQDONE"]
#[inline(always)]
pub fn dma_done_comb(self) -> &'a mut crate::W<REG> {
self.variant(Ev::DmaDoneComb)
}
#[doc = "UART0 combined interrupt, interrupt flags are found here UART0:MIS"]
#[inline(always)]
pub fn uart0_comb(self) -> &'a mut crate::W<REG> {
self.variant(Ev::Uart0Comb)
}
#[doc = "SSI1 combined interrupt, interrupt flags are found here SSI1:MIS"]
#[inline(always)]
pub fn ssi1_comb(self) -> &'a mut crate::W<REG> {
self.variant(Ev::Ssi1Comb)
}
#[doc = "SSI0 combined interrupt, interrupt flags are found here SSI0:MIS"]
#[inline(always)]
pub fn ssi0_comb(self) -> &'a mut crate::W<REG> {
self.variant(Ev::Ssi0Comb)
}
#[doc = "Watchdog interrupt event, controlled by WDT:CTL.INTEN"]
#[inline(always)]
pub fn wdt_irq(self) -> &'a mut crate::W<REG> {
self.variant(Ev::WdtIrq)
}
#[doc = "AUX Software event 0, AUX_EVCTL:SWEVSET.SWEV0"]
#[inline(always)]
pub fn aon_aux_swev0(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AonAuxSwev0)
}
#[doc = "Interrupt event from I2S"]
#[inline(always)]
pub fn i2s_irq(self) -> &'a mut crate::W<REG> {
self.variant(Ev::I2sIrq)
}
#[doc = "AON programmable event 1. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL.AON_PROG1_EV"]
#[inline(always)]
pub fn aon_prog1(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AonProg1)
}
#[doc = "AON programmable event 0. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL.AON_PROG0_EV"]
#[inline(always)]
pub fn aon_prog0(self) -> &'a mut crate::W<REG> {
self.variant(Ev::AonProg0)
}
#[doc = "Always inactive"]
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(Ev::None)
}
}
impl R {
#[doc = "Bits 0:6 - 6:0\\]
Read/write selection value Writing any other value than values defined by a ENUM may result in undefined behavior."]
#[inline(always)]
pub fn ev(&self) -> EvR {
EvR::new((self.bits & 0x7f) as u8)
}
}
impl W {
#[doc = "Bits 0:6 - 6:0\\]
Read/write selection value Writing any other value than values defined by a ENUM may result in undefined behavior."]
#[inline(always)]
#[must_use]
pub fn ev(&mut self) -> EvW<Rfcsel9Spec> {
EvW::new(self, 0)
}
}
#[doc = "Output Selection for RFC Event 9\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rfcsel9::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rfcsel9::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Rfcsel9Spec;
impl crate::RegisterSpec for Rfcsel9Spec {
type Ux = u32;
}
#[doc = "`read()` method returns [`rfcsel9::R`](R) reader structure"]
impl crate::Readable for Rfcsel9Spec {}
#[doc = "`write(|w| ..)` method takes [`rfcsel9::W`](W) writer structure"]
impl crate::Writable for Rfcsel9Spec {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets RFCSEL9 to value 0x02"]
impl crate::Resettable for Rfcsel9Spec {
const RESET_VALUE: u32 = 0x02;
}