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 {
Dmamux1Evt0 = 0,
Dmamux1Evt1 = 1,
Dmamux1Evt2 = 2,
Lptim1Out = 3,
Lptim2Out = 4,
Lptim3Out = 5,
Extit0 = 6,
Tim12Trgo = 7,
}
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) -> SIG_ID {
match self.bits {
0 => SIG_ID::Dmamux1Evt0,
1 => SIG_ID::Dmamux1Evt1,
2 => SIG_ID::Dmamux1Evt2,
3 => SIG_ID::Lptim1Out,
4 => SIG_ID::Lptim2Out,
5 => SIG_ID::Lptim3Out,
6 => SIG_ID::Extit0,
7 => SIG_ID::Tim12Trgo,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_dmamux1_evt0(&self) -> bool {
*self == SIG_ID::Dmamux1Evt0
}
#[inline(always)]
pub fn is_dmamux1_evt1(&self) -> bool {
*self == SIG_ID::Dmamux1Evt1
}
#[inline(always)]
pub fn is_dmamux1_evt2(&self) -> bool {
*self == SIG_ID::Dmamux1Evt2
}
#[inline(always)]
pub fn is_lptim1_out(&self) -> bool {
*self == SIG_ID::Lptim1Out
}
#[inline(always)]
pub fn is_lptim2_out(&self) -> bool {
*self == SIG_ID::Lptim2Out
}
#[inline(always)]
pub fn is_lptim3_out(&self) -> bool {
*self == SIG_ID::Lptim3Out
}
#[inline(always)]
pub fn is_extit0(&self) -> bool {
*self == SIG_ID::Extit0
}
#[inline(always)]
pub fn is_tim12_trgo(&self) -> bool {
*self == SIG_ID::Tim12Trgo
}
}
pub type SIG_ID_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SIG_ID, crate::Safe>;
impl<'a, REG> SIG_ID_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn dmamux1_evt0(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux1Evt0)
}
#[inline(always)]
pub fn dmamux1_evt1(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux1Evt1)
}
#[inline(always)]
pub fn dmamux1_evt2(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Dmamux1Evt2)
}
#[inline(always)]
pub fn lptim1_out(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim1Out)
}
#[inline(always)]
pub fn lptim2_out(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim2Out)
}
#[inline(always)]
pub fn lptim3_out(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Lptim3Out)
}
#[inline(always)]
pub fn extit0(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Extit0)
}
#[inline(always)]
pub fn tim12_trgo(self) -> &'a mut crate::W<REG> {
self.variant(SIG_ID::Tim12Trgo)
}
}
#[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 & 7) 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 {}