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 {
Gpio = 0,
Comp2Out = 1,
Comp1Out = 2,
Lse = 3,
}
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) -> ETR_RMP {
match self.bits {
0 => ETR_RMP::Gpio,
1 => ETR_RMP::Comp2Out,
2 => ETR_RMP::Comp1Out,
3 => ETR_RMP::Lse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_gpio(&self) -> bool {
*self == ETR_RMP::Gpio
}
#[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
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == ETR_RMP::Lse
}
}
pub type ETR_RMP_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ETR_RMP, crate::Safe>;
impl<'a, REG> ETR_RMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn gpio(self) -> &'a mut crate::W<REG> {
self.variant(ETR_RMP::Gpio)
}
#[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)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(ETR_RMP::Lse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TI1_RMP {
Gpio = 0,
Comp2Out = 1,
Comp1Out = 2,
}
impl From<TI1_RMP> for u8 {
#[inline(always)]
fn from(variant: TI1_RMP) -> Self {
variant as _
}
}
impl crate::FieldSpec for TI1_RMP {
type Ux = u8;
}
impl crate::IsEnum for TI1_RMP {}
pub type TI1_RMP_R = crate::FieldReader<TI1_RMP>;
impl TI1_RMP_R {
#[inline(always)]
pub const fn variant(&self) -> Option<TI1_RMP> {
match self.bits {
0 => Some(TI1_RMP::Gpio),
1 => Some(TI1_RMP::Comp2Out),
2 => Some(TI1_RMP::Comp1Out),
_ => None,
}
}
#[inline(always)]
pub fn is_gpio(&self) -> bool {
*self == TI1_RMP::Gpio
}
#[inline(always)]
pub fn is_comp2_out(&self) -> bool {
*self == TI1_RMP::Comp2Out
}
#[inline(always)]
pub fn is_comp1_out(&self) -> bool {
*self == TI1_RMP::Comp1Out
}
}
pub type TI1_RMP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TI1_RMP>;
impl<'a, REG> TI1_RMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn gpio(self) -> &'a mut crate::W<REG> {
self.variant(TI1_RMP::Gpio)
}
#[inline(always)]
pub fn comp2_out(self) -> &'a mut crate::W<REG> {
self.variant(TI1_RMP::Comp2Out)
}
#[inline(always)]
pub fn comp1_out(self) -> &'a mut crate::W<REG> {
self.variant(TI1_RMP::Comp1Out)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TI2_RMP {
Gpio = 0,
Comp2Out = 1,
}
impl From<TI2_RMP> for bool {
#[inline(always)]
fn from(variant: TI2_RMP) -> Self {
variant as u8 != 0
}
}
pub type TI2_RMP_R = crate::BitReader<TI2_RMP>;
impl TI2_RMP_R {
#[inline(always)]
pub const fn variant(&self) -> TI2_RMP {
match self.bits {
false => TI2_RMP::Gpio,
true => TI2_RMP::Comp2Out,
}
}
#[inline(always)]
pub fn is_gpio(&self) -> bool {
*self == TI2_RMP::Gpio
}
#[inline(always)]
pub fn is_comp2_out(&self) -> bool {
*self == TI2_RMP::Comp2Out
}
}
pub type TI2_RMP_W<'a, REG> = crate::BitWriter<'a, REG, TI2_RMP>;
impl<'a, REG> TI2_RMP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn gpio(self) -> &'a mut crate::W<REG> {
self.variant(TI2_RMP::Gpio)
}
#[inline(always)]
pub fn comp2_out(self) -> &'a mut crate::W<REG> {
self.variant(TI2_RMP::Comp2Out)
}
}
impl R {
#[inline(always)]
pub fn etr_rmp(&self) -> ETR_RMP_R {
ETR_RMP_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn ti1_rmp(&self) -> TI1_RMP_R {
TI1_RMP_R::new(((self.bits >> 2) & 7) as u8)
}
#[inline(always)]
pub fn ti2_rmp(&self) -> TI2_RMP_R {
TI2_RMP_R::new(((self.bits >> 5) & 1) != 0)
}
}
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("ti1_rmp", &self.ti1_rmp())
.field("ti2_rmp", &self.ti2_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 ti1_rmp(&mut self) -> TI1_RMP_W<ORrs> {
TI1_RMP_W::new(self, 2)
}
#[inline(always)]
pub fn ti2_rmp(&mut self) -> TI2_RMP_W<ORrs> {
TI2_RMP_W::new(self, 5)
}
}
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 {}