pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum REPMODE {
Free = 0,
Oneshot = 1,
Buffered = 2,
Double = 3,
}
impl From<REPMODE> for u8 {
#[inline(always)]
fn from(variant: REPMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for REPMODE {
type Ux = u8;
}
impl crate::IsEnum for REPMODE {}
pub type RepmodeR = crate::FieldReader<REPMODE>;
impl RepmodeR {
#[inline(always)]
pub const fn variant(&self) -> REPMODE {
match self.bits {
0 => REPMODE::Free,
1 => REPMODE::Oneshot,
2 => REPMODE::Buffered,
3 => REPMODE::Double,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_free(&self) -> bool {
*self == REPMODE::Free
}
#[inline(always)]
pub fn is_oneshot(&self) -> bool {
*self == REPMODE::Oneshot
}
#[inline(always)]
pub fn is_buffered(&self) -> bool {
*self == REPMODE::Buffered
}
#[inline(always)]
pub fn is_double(&self) -> bool {
*self == REPMODE::Double
}
}
pub type RepmodeW<'a, REG> = crate::FieldWriter<'a, REG, 2, REPMODE, crate::Safe>;
impl<'a, REG> RepmodeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn free(self) -> &'a mut crate::W<REG> {
self.variant(REPMODE::Free)
}
#[inline(always)]
pub fn oneshot(self) -> &'a mut crate::W<REG> {
self.variant(REPMODE::Oneshot)
}
#[inline(always)]
pub fn buffered(self) -> &'a mut crate::W<REG> {
self.variant(REPMODE::Buffered)
}
#[inline(always)]
pub fn double(self) -> &'a mut crate::W<REG> {
self.variant(REPMODE::Double)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum UFOA0 {
None = 0,
Toggle = 1,
Pulse = 2,
Pwm = 3,
}
impl From<UFOA0> for u8 {
#[inline(always)]
fn from(variant: UFOA0) -> Self {
variant as _
}
}
impl crate::FieldSpec for UFOA0 {
type Ux = u8;
}
impl crate::IsEnum for UFOA0 {}
pub type Ufoa0R = crate::FieldReader<UFOA0>;
impl Ufoa0R {
#[inline(always)]
pub const fn variant(&self) -> UFOA0 {
match self.bits {
0 => UFOA0::None,
1 => UFOA0::Toggle,
2 => UFOA0::Pulse,
3 => UFOA0::Pwm,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == UFOA0::None
}
#[inline(always)]
pub fn is_toggle(&self) -> bool {
*self == UFOA0::Toggle
}
#[inline(always)]
pub fn is_pulse(&self) -> bool {
*self == UFOA0::Pulse
}
#[inline(always)]
pub fn is_pwm(&self) -> bool {
*self == UFOA0::Pwm
}
}
pub type Ufoa0W<'a, REG> = crate::FieldWriter<'a, REG, 2, UFOA0, crate::Safe>;
impl<'a, REG> Ufoa0W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(UFOA0::None)
}
#[inline(always)]
pub fn toggle(self) -> &'a mut crate::W<REG> {
self.variant(UFOA0::Toggle)
}
#[inline(always)]
pub fn pulse(self) -> &'a mut crate::W<REG> {
self.variant(UFOA0::Pulse)
}
#[inline(always)]
pub fn pwm(self) -> &'a mut crate::W<REG> {
self.variant(UFOA0::Pwm)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum UFOA1 {
None = 0,
Toggle = 1,
Pulse = 2,
Pwm = 3,
}
impl From<UFOA1> for u8 {
#[inline(always)]
fn from(variant: UFOA1) -> Self {
variant as _
}
}
impl crate::FieldSpec for UFOA1 {
type Ux = u8;
}
impl crate::IsEnum for UFOA1 {}
pub type Ufoa1R = crate::FieldReader<UFOA1>;
impl Ufoa1R {
#[inline(always)]
pub const fn variant(&self) -> UFOA1 {
match self.bits {
0 => UFOA1::None,
1 => UFOA1::Toggle,
2 => UFOA1::Pulse,
3 => UFOA1::Pwm,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == UFOA1::None
}
#[inline(always)]
pub fn is_toggle(&self) -> bool {
*self == UFOA1::Toggle
}
#[inline(always)]
pub fn is_pulse(&self) -> bool {
*self == UFOA1::Pulse
}
#[inline(always)]
pub fn is_pwm(&self) -> bool {
*self == UFOA1::Pwm
}
}
pub type Ufoa1W<'a, REG> = crate::FieldWriter<'a, REG, 2, UFOA1, crate::Safe>;
impl<'a, REG> Ufoa1W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(UFOA1::None)
}
#[inline(always)]
pub fn toggle(self) -> &'a mut crate::W<REG> {
self.variant(UFOA1::Toggle)
}
#[inline(always)]
pub fn pulse(self) -> &'a mut crate::W<REG> {
self.variant(UFOA1::Pulse)
}
#[inline(always)]
pub fn pwm(self) -> &'a mut crate::W<REG> {
self.variant(UFOA1::Pwm)
}
}
pub type Opol0R = crate::BitReader;
pub type Opol0W<'a, REG> = crate::BitWriter<'a, REG>;
pub type Opol1R = crate::BitReader;
pub type Opol1W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BuftopR = crate::BitReader;
pub type BuftopW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Comp0topR = crate::BitReader;
pub type Comp0topW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DebugrunR = crate::BitReader;
pub type DebugrunW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn repmode(&self) -> RepmodeR {
RepmodeR::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn ufoa0(&self) -> Ufoa0R {
Ufoa0R::new(((self.bits >> 2) & 3) as u8)
}
#[inline(always)]
pub fn ufoa1(&self) -> Ufoa1R {
Ufoa1R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn opol0(&self) -> Opol0R {
Opol0R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn opol1(&self) -> Opol1R {
Opol1R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn buftop(&self) -> BuftopR {
BuftopR::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn comp0top(&self) -> Comp0topR {
Comp0topR::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn debugrun(&self) -> DebugrunR {
DebugrunR::new(((self.bits >> 12) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("repmode", &self.repmode())
.field("ufoa0", &self.ufoa0())
.field("ufoa1", &self.ufoa1())
.field("opol0", &self.opol0())
.field("opol1", &self.opol1())
.field("buftop", &self.buftop())
.field("comp0top", &self.comp0top())
.field("debugrun", &self.debugrun())
.finish()
}
}
impl W {
#[inline(always)]
pub fn repmode(&mut self) -> RepmodeW<'_, CTRLrs> {
RepmodeW::new(self, 0)
}
#[inline(always)]
pub fn ufoa0(&mut self) -> Ufoa0W<'_, CTRLrs> {
Ufoa0W::new(self, 2)
}
#[inline(always)]
pub fn ufoa1(&mut self) -> Ufoa1W<'_, CTRLrs> {
Ufoa1W::new(self, 4)
}
#[inline(always)]
pub fn opol0(&mut self) -> Opol0W<'_, CTRLrs> {
Opol0W::new(self, 6)
}
#[inline(always)]
pub fn opol1(&mut self) -> Opol1W<'_, CTRLrs> {
Opol1W::new(self, 7)
}
#[inline(always)]
pub fn buftop(&mut self) -> BuftopW<'_, CTRLrs> {
BuftopW::new(self, 8)
}
#[inline(always)]
pub fn comp0top(&mut self) -> Comp0topW<'_, CTRLrs> {
Comp0topW::new(self, 9)
}
#[inline(always)]
pub fn debugrun(&mut self) -> DebugrunW<'_, CTRLrs> {
DebugrunW::new(self, 12)
}
}
pub struct CTRLrs;
impl crate::RegisterSpec for CTRLrs {
type Ux = u32;
}
impl crate::Readable for CTRLrs {}
impl crate::Writable for CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CTRLrs {}