pub type R = crate::R<ORrs>;
pub type W = crate::W<ORrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ETR_RMP {
Hsi = 3,
Lse = 5,
Comp2Out = 6,
Comp1Out = 7,
}
impl From<ETR_RMP> for u8 {
#[inline(always)]
fn from(variant: ETR_RMP) -> Self {
variant as _
}
}
impl crate::FieldSpec for ETR_RMP {
type Ux = u8;
}
impl crate::IsEnum for ETR_RMP {}
pub type ETR_RMP_R = crate::FieldReader<ETR_RMP>;
impl ETR_RMP_R {
#[inline(always)]
pub const fn variant(&self) -> Option<ETR_RMP> {
match self.bits {
3 => Some(ETR_RMP::Hsi),
5 => Some(ETR_RMP::Lse),
6 => Some(ETR_RMP::Comp2Out),
7 => Some(ETR_RMP::Comp1Out),
_ => None,
}
}
#[inline(always)]
pub fn is_hsi(&self) -> bool {
*self == ETR_RMP::Hsi
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == ETR_RMP::Lse
}
#[inline(always)]
pub fn is_comp2_out(&self) -> bool {
*self == ETR_RMP::Comp2Out
}
#[inline(always)]
pub fn is_comp1_out(&self) -> bool {
*self == ETR_RMP::Comp1Out
}
}
pub type ETR_RMP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, ETR_RMP>;
impl<'a, REG> ETR_RMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn hsi(self) -> &'a mut crate::W<REG> {
self.variant(ETR_RMP::Hsi)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(ETR_RMP::Lse)
}
#[inline(always)]
pub fn comp2_out(self) -> &'a mut crate::W<REG> {
self.variant(ETR_RMP::Comp2Out)
}
#[inline(always)]
pub fn comp1_out(self) -> &'a mut crate::W<REG> {
self.variant(ETR_RMP::Comp1Out)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TI4_RMP {
Comp2Out = 1,
Comp1Out = 2,
}
impl From<TI4_RMP> for u8 {
#[inline(always)]
fn from(variant: TI4_RMP) -> Self {
variant as _
}
}
impl crate::FieldSpec for TI4_RMP {
type Ux = u8;
}
impl crate::IsEnum for TI4_RMP {}
pub type TI4_RMP_R = crate::FieldReader<TI4_RMP>;
impl TI4_RMP_R {
#[inline(always)]
pub const fn variant(&self) -> Option<TI4_RMP> {
match self.bits {
1 => Some(TI4_RMP::Comp2Out),
2 => Some(TI4_RMP::Comp1Out),
_ => None,
}
}
#[inline(always)]
pub fn is_comp2_out(&self) -> bool {
*self == TI4_RMP::Comp2Out
}
#[inline(always)]
pub fn is_comp1_out(&self) -> bool {
*self == TI4_RMP::Comp1Out
}
}
pub type TI4_RMP_W<'a, REG> = crate::FieldWriter<'a, REG, 2, TI4_RMP>;
impl<'a, REG> TI4_RMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn comp2_out(self) -> &'a mut crate::W<REG> {
self.variant(TI4_RMP::Comp2Out)
}
#[inline(always)]
pub fn comp1_out(self) -> &'a mut crate::W<REG> {
self.variant(TI4_RMP::Comp1Out)
}
}
impl R {
#[inline(always)]
pub fn etr_rmp(&self) -> ETR_RMP_R {
ETR_RMP_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn ti4_rmp(&self) -> TI4_RMP_R {
TI4_RMP_R::new(((self.bits >> 3) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OR")
.field("etr_rmp", &self.etr_rmp())
.field("ti4_rmp", &self.ti4_rmp())
.finish()
}
}
impl W {
#[inline(always)]
pub fn etr_rmp(&mut self) -> ETR_RMP_W<ORrs> {
ETR_RMP_W::new(self, 0)
}
#[inline(always)]
pub fn ti4_rmp(&mut self) -> TI4_RMP_W<ORrs> {
TI4_RMP_W::new(self, 3)
}
}
pub struct ORrs;
impl crate::RegisterSpec for ORrs {
type Ux = u32;
}
impl crate::Readable for ORrs {}
impl crate::Writable for ORrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for ORrs {}