pub type R = crate::R<OUTRrs>;
pub type W = crate::W<OUTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum POL1 {
ActiveHigh = 0,
ActiveLow = 1,
}
impl From<POL1> for bool {
#[inline(always)]
fn from(variant: POL1) -> Self {
variant as u8 != 0
}
}
pub type POL1_R = crate::BitReader<POL1>;
impl POL1_R {
#[inline(always)]
pub const fn variant(&self) -> POL1 {
match self.bits {
false => POL1::ActiveHigh,
true => POL1::ActiveLow,
}
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == POL1::ActiveHigh
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == POL1::ActiveLow
}
}
pub type POL1_W<'a, REG> = crate::BitWriter<'a, REG, POL1>;
impl<'a, REG> POL1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(POL1::ActiveHigh)
}
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(POL1::ActiveLow)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IDLEM1 {
NoEffect = 0,
SetIdle = 1,
}
impl From<IDLEM1> for bool {
#[inline(always)]
fn from(variant: IDLEM1) -> Self {
variant as u8 != 0
}
}
pub type IDLEM1_R = crate::BitReader<IDLEM1>;
impl IDLEM1_R {
#[inline(always)]
pub const fn variant(&self) -> IDLEM1 {
match self.bits {
false => IDLEM1::NoEffect,
true => IDLEM1::SetIdle,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == IDLEM1::NoEffect
}
#[inline(always)]
pub fn is_set_idle(&self) -> bool {
*self == IDLEM1::SetIdle
}
}
pub type IDLEM1_W<'a, REG> = crate::BitWriter<'a, REG, IDLEM1>;
impl<'a, REG> IDLEM1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(IDLEM1::NoEffect)
}
#[inline(always)]
pub fn set_idle(self) -> &'a mut crate::W<REG> {
self.variant(IDLEM1::SetIdle)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IDLES1 {
Inactive = 0,
Active = 1,
}
impl From<IDLES1> for bool {
#[inline(always)]
fn from(variant: IDLES1) -> Self {
variant as u8 != 0
}
}
pub type IDLES1_R = crate::BitReader<IDLES1>;
impl IDLES1_R {
#[inline(always)]
pub const fn variant(&self) -> IDLES1 {
match self.bits {
false => IDLES1::Inactive,
true => IDLES1::Active,
}
}
#[inline(always)]
pub fn is_inactive(&self) -> bool {
*self == IDLES1::Inactive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == IDLES1::Active
}
}
pub type IDLES1_W<'a, REG> = crate::BitWriter<'a, REG, IDLES1>;
impl<'a, REG> IDLES1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn inactive(self) -> &'a mut crate::W<REG> {
self.variant(IDLES1::Inactive)
}
#[inline(always)]
pub fn active(self) -> &'a mut crate::W<REG> {
self.variant(IDLES1::Active)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FAULT1 {
Disabled = 0,
SetActive = 1,
SetInactive = 2,
SetHighZ = 3,
}
impl From<FAULT1> for u8 {
#[inline(always)]
fn from(variant: FAULT1) -> Self {
variant as _
}
}
impl crate::FieldSpec for FAULT1 {
type Ux = u8;
}
impl crate::IsEnum for FAULT1 {}
pub type FAULT1_R = crate::FieldReader<FAULT1>;
impl FAULT1_R {
#[inline(always)]
pub const fn variant(&self) -> FAULT1 {
match self.bits {
0 => FAULT1::Disabled,
1 => FAULT1::SetActive,
2 => FAULT1::SetInactive,
3 => FAULT1::SetHighZ,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FAULT1::Disabled
}
#[inline(always)]
pub fn is_set_active(&self) -> bool {
*self == FAULT1::SetActive
}
#[inline(always)]
pub fn is_set_inactive(&self) -> bool {
*self == FAULT1::SetInactive
}
#[inline(always)]
pub fn is_set_high_z(&self) -> bool {
*self == FAULT1::SetHighZ
}
}
pub type FAULT1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FAULT1, crate::Safe>;
impl<'a, REG> FAULT1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FAULT1::Disabled)
}
#[inline(always)]
pub fn set_active(self) -> &'a mut crate::W<REG> {
self.variant(FAULT1::SetActive)
}
#[inline(always)]
pub fn set_inactive(self) -> &'a mut crate::W<REG> {
self.variant(FAULT1::SetInactive)
}
#[inline(always)]
pub fn set_high_z(self) -> &'a mut crate::W<REG> {
self.variant(FAULT1::SetHighZ)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CHP1 {
Disabled = 0,
Enabled = 1,
}
impl From<CHP1> for bool {
#[inline(always)]
fn from(variant: CHP1) -> Self {
variant as u8 != 0
}
}
pub type CHP1_R = crate::BitReader<CHP1>;
impl CHP1_R {
#[inline(always)]
pub const fn variant(&self) -> CHP1 {
match self.bits {
false => CHP1::Disabled,
true => CHP1::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CHP1::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CHP1::Enabled
}
}
pub type CHP1_W<'a, REG> = crate::BitWriter<'a, REG, CHP1>;
impl<'a, REG> CHP1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CHP1::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CHP1::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DIDL1 {
Disabled = 0,
Enabled = 1,
}
impl From<DIDL1> for bool {
#[inline(always)]
fn from(variant: DIDL1) -> Self {
variant as u8 != 0
}
}
pub type DIDL1_R = crate::BitReader<DIDL1>;
impl DIDL1_R {
#[inline(always)]
pub const fn variant(&self) -> DIDL1 {
match self.bits {
false => DIDL1::Disabled,
true => DIDL1::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DIDL1::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DIDL1::Enabled
}
}
pub type DIDL1_W<'a, REG> = crate::BitWriter<'a, REG, DIDL1>;
impl<'a, REG> DIDL1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DIDL1::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DIDL1::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DTEN {
Disabled = 0,
Enabled = 1,
}
impl From<DTEN> for bool {
#[inline(always)]
fn from(variant: DTEN) -> Self {
variant as u8 != 0
}
}
pub type DTEN_R = crate::BitReader<DTEN>;
impl DTEN_R {
#[inline(always)]
pub const fn variant(&self) -> DTEN {
match self.bits {
false => DTEN::Disabled,
true => DTEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DTEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DTEN::Enabled
}
}
pub type DTEN_W<'a, REG> = crate::BitWriter<'a, REG, DTEN>;
impl<'a, REG> DTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DTEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DTEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DLYPRTEN {
Disabled = 0,
Enabled = 1,
}
impl From<DLYPRTEN> for bool {
#[inline(always)]
fn from(variant: DLYPRTEN) -> Self {
variant as u8 != 0
}
}
pub type DLYPRTEN_R = crate::BitReader<DLYPRTEN>;
impl DLYPRTEN_R {
#[inline(always)]
pub const fn variant(&self) -> DLYPRTEN {
match self.bits {
false => DLYPRTEN::Disabled,
true => DLYPRTEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DLYPRTEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DLYPRTEN::Enabled
}
}
pub type DLYPRTEN_W<'a, REG> = crate::BitWriter<'a, REG, DLYPRTEN>;
impl<'a, REG> DLYPRTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRTEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRTEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DLYPRT {
Output1Ee6 = 0,
Output2Ee6 = 1,
Output1_2Ee6 = 2,
BalancedEe6 = 3,
Output1Ee7 = 4,
Output2Ee7 = 5,
Output1_2Ee7 = 6,
BalancedEe7 = 7,
}
impl From<DLYPRT> for u8 {
#[inline(always)]
fn from(variant: DLYPRT) -> Self {
variant as _
}
}
impl crate::FieldSpec for DLYPRT {
type Ux = u8;
}
impl crate::IsEnum for DLYPRT {}
pub type DLYPRT_R = crate::FieldReader<DLYPRT>;
impl DLYPRT_R {
#[inline(always)]
pub const fn variant(&self) -> DLYPRT {
match self.bits {
0 => DLYPRT::Output1Ee6,
1 => DLYPRT::Output2Ee6,
2 => DLYPRT::Output1_2Ee6,
3 => DLYPRT::BalancedEe6,
4 => DLYPRT::Output1Ee7,
5 => DLYPRT::Output2Ee7,
6 => DLYPRT::Output1_2Ee7,
7 => DLYPRT::BalancedEe7,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_output1_ee6(&self) -> bool {
*self == DLYPRT::Output1Ee6
}
#[inline(always)]
pub fn is_output2_ee6(&self) -> bool {
*self == DLYPRT::Output2Ee6
}
#[inline(always)]
pub fn is_output1_2_ee6(&self) -> bool {
*self == DLYPRT::Output1_2Ee6
}
#[inline(always)]
pub fn is_balanced_ee6(&self) -> bool {
*self == DLYPRT::BalancedEe6
}
#[inline(always)]
pub fn is_output1_ee7(&self) -> bool {
*self == DLYPRT::Output1Ee7
}
#[inline(always)]
pub fn is_output2_ee7(&self) -> bool {
*self == DLYPRT::Output2Ee7
}
#[inline(always)]
pub fn is_output1_2_ee7(&self) -> bool {
*self == DLYPRT::Output1_2Ee7
}
#[inline(always)]
pub fn is_balanced_ee7(&self) -> bool {
*self == DLYPRT::BalancedEe7
}
}
pub type DLYPRT_W<'a, REG> = crate::FieldWriter<'a, REG, 3, DLYPRT, crate::Safe>;
impl<'a, REG> DLYPRT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn output1_ee6(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::Output1Ee6)
}
#[inline(always)]
pub fn output2_ee6(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::Output2Ee6)
}
#[inline(always)]
pub fn output1_2_ee6(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::Output1_2Ee6)
}
#[inline(always)]
pub fn balanced_ee6(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::BalancedEe6)
}
#[inline(always)]
pub fn output1_ee7(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::Output1Ee7)
}
#[inline(always)]
pub fn output2_ee7(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::Output2Ee7)
}
#[inline(always)]
pub fn output1_2_ee7(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::Output1_2Ee7)
}
#[inline(always)]
pub fn balanced_ee7(self) -> &'a mut crate::W<REG> {
self.variant(DLYPRT::BalancedEe7)
}
}
pub use CHP1_R as CHP2_R;
pub use CHP1_W as CHP2_W;
pub use DIDL1_R as DIDL2_R;
pub use DIDL1_W as DIDL2_W;
pub use FAULT1_R as FAULT2_R;
pub use FAULT1_W as FAULT2_W;
pub use IDLEM1_R as IDLEM2_R;
pub use IDLEM1_W as IDLEM2_W;
pub use IDLES1_R as IDLES2_R;
pub use IDLES1_W as IDLES2_W;
pub use POL1_R as POL2_R;
pub use POL1_W as POL2_W;
impl R {
#[inline(always)]
pub fn pol1(&self) -> POL1_R {
POL1_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn idlem1(&self) -> IDLEM1_R {
IDLEM1_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn idles1(&self) -> IDLES1_R {
IDLES1_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn fault1(&self) -> FAULT1_R {
FAULT1_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn chp1(&self) -> CHP1_R {
CHP1_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn didl1(&self) -> DIDL1_R {
DIDL1_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn dten(&self) -> DTEN_R {
DTEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn dlyprten(&self) -> DLYPRTEN_R {
DLYPRTEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn dlyprt(&self) -> DLYPRT_R {
DLYPRT_R::new(((self.bits >> 10) & 7) as u8)
}
#[inline(always)]
pub fn pol2(&self) -> POL2_R {
POL2_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn idlem2(&self) -> IDLEM2_R {
IDLEM2_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn idles2(&self) -> IDLES2_R {
IDLES2_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn fault2(&self) -> FAULT2_R {
FAULT2_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn chp2(&self) -> CHP2_R {
CHP2_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn didl2(&self) -> DIDL2_R {
DIDL2_R::new(((self.bits >> 23) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OUTR")
.field("didl1", &self.didl1())
.field("didl2", &self.didl2())
.field("chp1", &self.chp1())
.field("chp2", &self.chp2())
.field("fault1", &self.fault1())
.field("fault2", &self.fault2())
.field("idles1", &self.idles1())
.field("idles2", &self.idles2())
.field("idlem1", &self.idlem1())
.field("idlem2", &self.idlem2())
.field("pol1", &self.pol1())
.field("pol2", &self.pol2())
.field("dlyprt", &self.dlyprt())
.field("dlyprten", &self.dlyprten())
.field("dten", &self.dten())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pol1(&mut self) -> POL1_W<OUTRrs> {
POL1_W::new(self, 1)
}
#[inline(always)]
pub fn idlem1(&mut self) -> IDLEM1_W<OUTRrs> {
IDLEM1_W::new(self, 2)
}
#[inline(always)]
pub fn idles1(&mut self) -> IDLES1_W<OUTRrs> {
IDLES1_W::new(self, 3)
}
#[inline(always)]
pub fn fault1(&mut self) -> FAULT1_W<OUTRrs> {
FAULT1_W::new(self, 4)
}
#[inline(always)]
pub fn chp1(&mut self) -> CHP1_W<OUTRrs> {
CHP1_W::new(self, 6)
}
#[inline(always)]
pub fn didl1(&mut self) -> DIDL1_W<OUTRrs> {
DIDL1_W::new(self, 7)
}
#[inline(always)]
pub fn dten(&mut self) -> DTEN_W<OUTRrs> {
DTEN_W::new(self, 8)
}
#[inline(always)]
pub fn dlyprten(&mut self) -> DLYPRTEN_W<OUTRrs> {
DLYPRTEN_W::new(self, 9)
}
#[inline(always)]
pub fn dlyprt(&mut self) -> DLYPRT_W<OUTRrs> {
DLYPRT_W::new(self, 10)
}
#[inline(always)]
pub fn pol2(&mut self) -> POL2_W<OUTRrs> {
POL2_W::new(self, 17)
}
#[inline(always)]
pub fn idlem2(&mut self) -> IDLEM2_W<OUTRrs> {
IDLEM2_W::new(self, 18)
}
#[inline(always)]
pub fn idles2(&mut self) -> IDLES2_W<OUTRrs> {
IDLES2_W::new(self, 19)
}
#[inline(always)]
pub fn fault2(&mut self) -> FAULT2_W<OUTRrs> {
FAULT2_W::new(self, 20)
}
#[inline(always)]
pub fn chp2(&mut self) -> CHP2_W<OUTRrs> {
CHP2_W::new(self, 22)
}
#[inline(always)]
pub fn didl2(&mut self) -> DIDL2_W<OUTRrs> {
DIDL2_W::new(self, 23)
}
}
pub struct OUTRrs;
impl crate::RegisterSpec for OUTRrs {
type Ux = u32;
}
impl crate::Readable for OUTRrs {}
impl crate::Writable for OUTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OUTRrs {}