pub type R = crate::R<RGCRrs>;
pub type W = crate::W<RGCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SIG_ID {
Dmamux2Evt0 = 0,
Dmamux2Evt1 = 1,
Dmamux2Evt2 = 2,
Dmamux2Evt3 = 3,
Dmamux2Evt4 = 4,
Dmamux2Evt5 = 5,
Dmamux2Evt6 = 6,
LpuartRxWkup = 7,
LpuartTxWkup = 8,
Lptim2Wkup = 9,
Lptim2Out = 10,
Lptim3Wkup = 11,
Lptim3Out = 12,
Lptim4Ait = 13,
Lptim5Ait = 14,
I2c4Wkup = 15,
Spi6Wkup = 16,
Comp1Out = 17,
Comp2Out = 18,
RtcWkup = 19,
SyscfgExti0Mux = 20,
SyscfgExti2Mux = 21,
I2c4EventIt = 22,
Spi6It = 23,
Lpuart1ItT = 24,
Lpuart1ItR = 25,
Adc3It = 26,
Adc3Awd1 = 27,
BdmaCh0It = 28,
BdmaCh1It = 29,
}
impl From<SIG_ID> for u8 {
#[inline(always)]
fn from(variant: SIG_ID) -> Self {
variant as _
}
}
impl crate::FieldSpec for SIG_ID {
type Ux = u8;
}
impl crate::IsEnum for SIG_ID {}
pub type SIG_ID_R = crate::FieldReader<SIG_ID>;
impl SIG_ID_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SIG_ID> {
match self.bits {
0 => Some(SIG_ID::Dmamux2Evt0),
1 => Some(SIG_ID::Dmamux2Evt1),
2 => Some(SIG_ID::Dmamux2Evt2),
3 => Some(SIG_ID::Dmamux2Evt3),
4 => Some(SIG_ID::Dmamux2Evt4),
5 => Some(SIG_ID::Dmamux2Evt5),
6 => Some(SIG_ID::Dmamux2Evt6),
7 => Some(SIG_ID::LpuartRxWkup),
8 => Some(SIG_ID::LpuartTxWkup),
9 => Some(SIG_ID::Lptim2Wkup),
10 => Some(SIG_ID::Lptim2Out),
11 => Some(SIG_ID::Lptim3Wkup),
12 => Some(SIG_ID::Lptim3Out),
13 => Some(SIG_ID::Lptim4Ait),
14 => Some(SIG_ID::Lptim5Ait),
15 => Some(SIG_ID::I2c4Wkup),
16 => Some(SIG_ID::Spi6Wkup),
17 => Some(SIG_ID::Comp1Out),
18 => Some(SIG_ID::Comp2Out),
19 => Some(SIG_ID::RtcWkup),
20 => Some(SIG_ID::SyscfgExti0Mux),
21 => Some(SIG_ID::SyscfgExti2Mux),
22 => Some(SIG_ID::I2c4EventIt),
23 => Some(SIG_ID::Spi6It),
24 => Some(SIG_ID::Lpuart1ItT),
25 => Some(SIG_ID::Lpuart1ItR),
26 => Some(SIG_ID::Adc3It),
27 => Some(SIG_ID::Adc3Awd1),
28 => Some(SIG_ID::BdmaCh0It),
29 => Some(SIG_ID::BdmaCh1It),
_ => None,
}
}
#[inline(always)]
pub fn is_dmamux2_evt0(&self) -> bool {
*self == SIG_ID::Dmamux2Evt0
}
#[inline(always)]
pub fn is_dmamux2_evt1(&self) -> bool {
*self == SIG_ID::Dmamux2Evt1
}
#[inline(always)]
pub fn is_dmamux2_evt2(&self) -> bool {
*self == SIG_ID::Dmamux2Evt2
}
#[inline(always)]
pub fn is_dmamux2_evt3(&self) -> bool {
*self == SIG_ID::Dmamux2Evt3
}
#[inline(always)]
pub fn is_dmamux2_evt4(&self) -> bool {
*self == SIG_ID::Dmamux2Evt4
}
#[inline(always)]
pub fn is_dmamux2_evt5(&self) -> bool {
*self == SIG_ID::Dmamux2Evt5
}
#[inline(always)]
pub fn is_dmamux2_evt6(&self) -> bool {
*self == SIG_ID::Dmamux2Evt6
}
#[inline(always)]
pub fn is_lpuart_rx_wkup(&self) -> bool {
*self == SIG_ID::LpuartRxWkup
}
#[inline(always)]
pub fn is_lpuart_tx_wkup(&self) -> bool {
*self == SIG_ID::LpuartTxWkup
}
#[inline(always)]
pub fn is_lptim2_wkup(&self) -> bool {
*self == SIG_ID::Lptim2Wkup
}
#[inline(always)]
pub fn is_lptim2_out(&self) -> bool {
*self == SIG_ID::Lptim2Out
}
#[inline(always)]
pub fn is_lptim3_wkup(&self) -> bool {
*self == SIG_ID::Lptim3Wkup
}
#[inline(always)]
pub fn is_lptim3_out(&self) -> bool {
*self == SIG_ID::Lptim3Out
}
#[inline(always)]
pub fn is_lptim4_ait(&self) -> bool {
*self == SIG_ID::Lptim4Ait
}
#[inline(always)]
pub fn is_lptim5_ait(&self) -> bool {
*self == SIG_ID::Lptim5Ait
}
#[inline(always)]
pub fn is_i2c4_wkup(&self) -> bool {
*self == SIG_ID::I2c4Wkup
}
#[inline(always)]
pub fn is_spi6_wkup(&self) -> bool {
*self == SIG_ID::Spi6Wkup
}
#[inline(always)]
pub fn is_comp1_out(&self) -> bool {
*self == SIG_ID::Comp1Out
}
#[inline(always)]
pub fn is_comp2_out(&self) -> bool {
*self == SIG_ID::Comp2Out
}
#[inline(always)]
pub fn is_rtc_wkup(&self) -> bool {
*self == SIG_ID::RtcWkup
}
#[inline(always)]
pub fn is_syscfg_exti0_mux(&self) -> bool {
*self == SIG_ID::SyscfgExti0Mux
}
#[inline(always)]
pub fn is_syscfg_exti2_mux(&self) -> bool {
*self == SIG_ID::SyscfgExti2Mux
}
#[inline(always)]
pub fn is_i2c4_event_it(&self) -> bool {
*self == SIG_ID::I2c4EventIt
}
#[inline(always)]
pub fn is_spi6_it(&self) -> bool {
*self == SIG_ID::Spi6It
}
#[inline(always)]
pub fn is_lpuart1_it_t(&self) -> bool {
*self == SIG_ID::Lpuart1ItT
}
#[inline(always)]
pub fn is_lpuart1_it_r(&self) -> bool {
*self == SIG_ID::Lpuart1ItR
}
#[inline(always)]
pub fn is_adc3_it(&self) -> bool {
*self == SIG_ID::Adc3It
}
#[inline(always)]
pub fn is_adc3_awd1(&self) -> bool {
*self == SIG_ID::Adc3Awd1
}
#[inline(always)]
pub fn is_bdma_ch0_it(&self) -> bool {
*self == SIG_ID::BdmaCh0It
}
#[inline(always)]
pub fn is_bdma_ch1_it(&self) -> bool {
*self == SIG_ID::BdmaCh1It
}
}
pub type SIG_ID_W<'a, REG> = crate::FieldWriter<'a, REG, 5, SIG_ID>;
impl<'a, REG> SIG_ID_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn dmamux2_evt0(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux2Evt0)
}
#[inline(always)]
pub fn dmamux2_evt1(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux2Evt1)
}
#[inline(always)]
pub fn dmamux2_evt2(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux2Evt2)
}
#[inline(always)]
pub fn dmamux2_evt3(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux2Evt3)
}
#[inline(always)]
pub fn dmamux2_evt4(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux2Evt4)
}
#[inline(always)]
pub fn dmamux2_evt5(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux2Evt5)
}
#[inline(always)]
pub fn dmamux2_evt6(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux2Evt6)
}
#[inline(always)]
pub fn lpuart_rx_wkup(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::LpuartRxWkup)
}
#[inline(always)]
pub fn lpuart_tx_wkup(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::LpuartTxWkup)
}
#[inline(always)]
pub fn lptim2_wkup(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim2Wkup)
}
#[inline(always)]
pub fn lptim2_out(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim2Out)
}
#[inline(always)]
pub fn lptim3_wkup(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim3Wkup)
}
#[inline(always)]
pub fn lptim3_out(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim3Out)
}
#[inline(always)]
pub fn lptim4_ait(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim4Ait)
}
#[inline(always)]
pub fn lptim5_ait(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim5Ait)
}
#[inline(always)]
pub fn i2c4_wkup(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::I2c4Wkup)
}
#[inline(always)]
pub fn spi6_wkup(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Spi6Wkup)
}
#[inline(always)]
pub fn comp1_out(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Comp1Out)
}
#[inline(always)]
pub fn comp2_out(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Comp2Out)
}
#[inline(always)]
pub fn rtc_wkup(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::RtcWkup)
}
#[inline(always)]
pub fn syscfg_exti0_mux(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::SyscfgExti0Mux)
}
#[inline(always)]
pub fn syscfg_exti2_mux(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::SyscfgExti2Mux)
}
#[inline(always)]
pub fn i2c4_event_it(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::I2c4EventIt)
}
#[inline(always)]
pub fn spi6_it(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Spi6It)
}
#[inline(always)]
pub fn lpuart1_it_t(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lpuart1ItT)
}
#[inline(always)]
pub fn lpuart1_it_r(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lpuart1ItR)
}
#[inline(always)]
pub fn adc3_it(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Adc3It)
}
#[inline(always)]
pub fn adc3_awd1(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Adc3Awd1)
}
#[inline(always)]
pub fn bdma_ch0_it(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::BdmaCh0It)
}
#[inline(always)]
pub fn bdma_ch1_it(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::BdmaCh1It)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OIE {
Disabled = 0,
Enabled = 1,
}
impl From<OIE> for bool {
#[inline(always)]
fn from(variant: OIE) -> Self {
variant as u8 != 0
}
}
pub type OIE_R = crate::BitReader<OIE>;
impl OIE_R {
#[inline(always)]
pub const fn variant(&self) -> OIE {
match self.bits {
false => OIE::Disabled,
true => OIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == OIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == OIE::Enabled
}
}
pub type OIE_W<'a, REG> = crate::BitWriter<'a, REG, OIE>;
impl<'a, REG> OIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(OIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(OIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum GE {
Disabled = 0,
Enabled = 1,
}
impl From<GE> for bool {
#[inline(always)]
fn from(variant: GE) -> Self {
variant as u8 != 0
}
}
pub type GE_R = crate::BitReader<GE>;
impl GE_R {
#[inline(always)]
pub const fn variant(&self) -> GE {
match self.bits {
false => GE::Disabled,
true => GE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == GE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == GE::Enabled
}
}
pub type GE_W<'a, REG> = crate::BitWriter<'a, REG, GE>;
impl<'a, REG> GE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(GE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(GE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum GPOL {
NoEdge = 0,
RisingEdge = 1,
FallingEdge = 2,
BothEdges = 3,
}
impl From<GPOL> for u8 {
#[inline(always)]
fn from(variant: GPOL) -> Self {
variant as _
}
}
impl crate::FieldSpec for GPOL {
type Ux = u8;
}
impl crate::IsEnum for GPOL {}
pub type GPOL_R = crate::FieldReader<GPOL>;
impl GPOL_R {
#[inline(always)]
pub const fn variant(&self) -> GPOL {
match self.bits {
0 => GPOL::NoEdge,
1 => GPOL::RisingEdge,
2 => GPOL::FallingEdge,
3 => GPOL::BothEdges,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_edge(&self) -> bool {
*self == GPOL::NoEdge
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == GPOL::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == GPOL::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == GPOL::BothEdges
}
}
pub type GPOL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, GPOL, crate::Safe>;
impl<'a, REG> GPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_edge(self) -> &'a mut crate::W<REG> {
self.variant(GPOL::NoEdge)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(GPOL::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(GPOL::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(GPOL::BothEdges)
}
}
pub type GNBREQ_R = crate::FieldReader;
pub type GNBREQ_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
impl R {
#[inline(always)]
pub fn sig_id(&self) -> SIG_ID_R {
SIG_ID_R::new((self.bits & 0x1f) as u8)
}
#[inline(always)]
pub fn oie(&self) -> OIE_R {
OIE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ge(&self) -> GE_R {
GE_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn gpol(&self) -> GPOL_R {
GPOL_R::new(((self.bits >> 17) & 3) as u8)
}
#[inline(always)]
pub fn gnbreq(&self) -> GNBREQ_R {
GNBREQ_R::new(((self.bits >> 19) & 0x1f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("RGCR")
.field("sig_id", &self.sig_id())
.field("oie", &self.oie())
.field("ge", &self.ge())
.field("gpol", &self.gpol())
.field("gnbreq", &self.gnbreq())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sig_id(&mut self) -> SIG_ID_W<RGCRrs> {
SIG_ID_W::new(self, 0)
}
#[inline(always)]
pub fn oie(&mut self) -> OIE_W<RGCRrs> {
OIE_W::new(self, 8)
}
#[inline(always)]
pub fn ge(&mut self) -> GE_W<RGCRrs> {
GE_W::new(self, 16)
}
#[inline(always)]
pub fn gpol(&mut self) -> GPOL_W<RGCRrs> {
GPOL_W::new(self, 17)
}
#[inline(always)]
pub fn gnbreq(&mut self) -> GNBREQ_W<RGCRrs> {
GNBREQ_W::new(self, 19)
}
}
pub struct RGCRrs;
impl crate::RegisterSpec for RGCRrs {
type Ux = u32;
}
impl crate::Readable for RGCRrs {}
impl crate::Writable for RGCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for RGCRrs {}