mcxa_pac/flexpwm0/
fctrl20.rs1#[doc = "Register `FCTRL20` reader"]
2pub type R = crate::R<Fctrl20Spec>;
3#[doc = "Register `FCTRL20` writer"]
4pub type W = crate::W<Fctrl20Spec>;
5#[doc = "No Combinational Path From Fault Input To PWM Output\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Nocomb {
10 #[doc = "0: There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined with the filtered and latched fault signals to disable the PWM outputs."]
11 Enabled = 0,
12 #[doc = "1: The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered and latched fault signals are used to disable the PWM outputs."]
13 Disabled = 1,
14}
15impl From<Nocomb> for u8 {
16 #[inline(always)]
17 fn from(variant: Nocomb) -> Self {
18 variant as _
19 }
20}
21impl crate::FieldSpec for Nocomb {
22 type Ux = u8;
23}
24impl crate::IsEnum for Nocomb {}
25#[doc = "Field `NOCOMB` reader - No Combinational Path From Fault Input To PWM Output"]
26pub type NocombR = crate::FieldReader<Nocomb>;
27impl NocombR {
28 #[doc = "Get enumerated values variant"]
29 #[inline(always)]
30 pub const fn variant(&self) -> Option<Nocomb> {
31 match self.bits {
32 0 => Some(Nocomb::Enabled),
33 1 => Some(Nocomb::Disabled),
34 _ => None,
35 }
36 }
37 #[doc = "There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined with the filtered and latched fault signals to disable the PWM outputs."]
38 #[inline(always)]
39 pub fn is_enabled(&self) -> bool {
40 *self == Nocomb::Enabled
41 }
42 #[doc = "The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered and latched fault signals are used to disable the PWM outputs."]
43 #[inline(always)]
44 pub fn is_disabled(&self) -> bool {
45 *self == Nocomb::Disabled
46 }
47}
48#[doc = "Field `NOCOMB` writer - No Combinational Path From Fault Input To PWM Output"]
49pub type NocombW<'a, REG> = crate::FieldWriter<'a, REG, 4, Nocomb>;
50impl<'a, REG> NocombW<'a, REG>
51where
52 REG: crate::Writable + crate::RegisterSpec,
53 REG::Ux: From<u8>,
54{
55 #[doc = "There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined with the filtered and latched fault signals to disable the PWM outputs."]
56 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(Nocomb::Enabled)
59 }
60 #[doc = "The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered and latched fault signals are used to disable the PWM outputs."]
61 #[inline(always)]
62 pub fn disabled(self) -> &'a mut crate::W<REG> {
63 self.variant(Nocomb::Disabled)
64 }
65}
66impl R {
67 #[doc = "Bits 0:3 - No Combinational Path From Fault Input To PWM Output"]
68 #[inline(always)]
69 pub fn nocomb(&self) -> NocombR {
70 NocombR::new((self.bits & 0x0f) as u8)
71 }
72}
73#[cfg(feature = "debug")]
74impl core::fmt::Debug for R {
75 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
76 f.debug_struct("FCTRL20").field("nocomb", &self.nocomb()).finish()
77 }
78}
79impl W {
80 #[doc = "Bits 0:3 - No Combinational Path From Fault Input To PWM Output"]
81 #[inline(always)]
82 pub fn nocomb(&mut self) -> NocombW<'_, Fctrl20Spec> {
83 NocombW::new(self, 0)
84 }
85}
86#[doc = "Fault Control 2 Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fctrl20::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fctrl20::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
87pub struct Fctrl20Spec;
88impl crate::RegisterSpec for Fctrl20Spec {
89 type Ux = u16;
90}
91#[doc = "`read()` method returns [`fctrl20::R`](R) reader structure"]
92impl crate::Readable for Fctrl20Spec {}
93#[doc = "`write(|w| ..)` method takes [`fctrl20::W`](W) writer structure"]
94impl crate::Writable for Fctrl20Spec {
95 type Safety = crate::Unsafe;
96}
97#[doc = "`reset()` method sets FCTRL20 to value 0"]
98impl crate::Resettable for Fctrl20Spec {}