#[doc = "PWM Channel Counter Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ccnt(pub u32);
impl Ccnt {
#[doc = "Channel Counter Register"]
#[must_use]
#[inline(always)]
pub const fn cnt(&self) -> u32 {
let val = (self.0 >> 0usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Channel Counter Register"]
#[inline(always)]
pub const fn set_cnt(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
}
}
impl Default for Ccnt {
#[inline(always)]
fn default() -> Ccnt {
Ccnt(0)
}
}
impl core::fmt::Debug for Ccnt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ccnt").field("cnt", &self.cnt()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ccnt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Ccnt {{ cnt: {=u32:?} }}", self.cnt())
}
}
#[doc = "PWM Channel Duty Cycle Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cdty(pub u32);
impl Cdty {
#[doc = "Channel Duty-Cycle"]
#[must_use]
#[inline(always)]
pub const fn cdty(&self) -> u32 {
let val = (self.0 >> 0usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Channel Duty-Cycle"]
#[inline(always)]
pub const fn set_cdty(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
}
}
impl Default for Cdty {
#[inline(always)]
fn default() -> Cdty {
Cdty(0)
}
}
impl core::fmt::Debug for Cdty {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cdty").field("cdty", &self.cdty()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cdty {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Cdty {{ cdty: {=u32:?} }}", self.cdty())
}
}
#[doc = "PWM Channel Duty Cycle Update Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cdtyupd(pub u32);
impl Cdtyupd {
#[doc = "Channel Duty-Cycle Update"]
#[must_use]
#[inline(always)]
pub const fn cdtyupd(&self) -> u32 {
let val = (self.0 >> 0usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Channel Duty-Cycle Update"]
#[inline(always)]
pub const fn set_cdtyupd(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
}
}
impl Default for Cdtyupd {
#[inline(always)]
fn default() -> Cdtyupd {
Cdtyupd(0)
}
}
impl core::fmt::Debug for Cdtyupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cdtyupd")
.field("cdtyupd", &self.cdtyupd())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cdtyupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Cdtyupd {{ cdtyupd: {=u32:?} }}", self.cdtyupd())
}
}
#[doc = "PWM Clock Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Clk(pub u32);
impl Clk {
#[doc = "CLKA, CLKB Divide Factor"]
#[must_use]
#[inline(always)]
pub const fn diva(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "CLKA, CLKB Divide Factor"]
#[inline(always)]
pub const fn set_diva(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
#[doc = "CLKA, CLKB Source Clock Selection"]
#[must_use]
#[inline(always)]
pub const fn prea(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "CLKA, CLKB Source Clock Selection"]
#[inline(always)]
pub const fn set_prea(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "CLKA, CLKB Divide Factor"]
#[must_use]
#[inline(always)]
pub const fn divb(&self) -> u8 {
let val = (self.0 >> 16usize) & 0xff;
val as u8
}
#[doc = "CLKA, CLKB Divide Factor"]
#[inline(always)]
pub const fn set_divb(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
}
#[doc = "CLKA, CLKB Source Clock Selection"]
#[must_use]
#[inline(always)]
pub const fn preb(&self) -> u8 {
let val = (self.0 >> 24usize) & 0x0f;
val as u8
}
#[doc = "CLKA, CLKB Source Clock Selection"]
#[inline(always)]
pub const fn set_preb(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 24usize)) | (((val as u32) & 0x0f) << 24usize);
}
}
impl Default for Clk {
#[inline(always)]
fn default() -> Clk {
Clk(0)
}
}
impl core::fmt::Debug for Clk {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Clk")
.field("diva", &self.diva())
.field("prea", &self.prea())
.field("divb", &self.divb())
.field("preb", &self.preb())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Clk {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Clk {{ diva: {=u8:?}, prea: {=u8:?}, divb: {=u8:?}, preb: {=u8:?} }}",
self.diva(),
self.prea(),
self.divb(),
self.preb()
)
}
}
#[doc = "PWM Comparison 0 Mode Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cmpm(pub u32);
impl Cmpm {
#[doc = "Comparison x Enable"]
#[must_use]
#[inline(always)]
pub const fn cen(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Comparison x Enable"]
#[inline(always)]
pub const fn set_cen(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Comparison x Trigger"]
#[must_use]
#[inline(always)]
pub const fn ctr(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Trigger"]
#[inline(always)]
pub const fn set_ctr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "Comparison x Period"]
#[must_use]
#[inline(always)]
pub const fn cpr(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Period"]
#[inline(always)]
pub const fn set_cpr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Comparison x Period Counter"]
#[must_use]
#[inline(always)]
pub const fn cprcnt(&self) -> u8 {
let val = (self.0 >> 12usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Period Counter"]
#[inline(always)]
pub const fn set_cprcnt(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 12usize)) | (((val as u32) & 0x0f) << 12usize);
}
#[doc = "Comparison x Update Period"]
#[must_use]
#[inline(always)]
pub const fn cupr(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Update Period"]
#[inline(always)]
pub const fn set_cupr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
#[doc = "Comparison x Update Period Counter"]
#[must_use]
#[inline(always)]
pub const fn cuprcnt(&self) -> u8 {
let val = (self.0 >> 20usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Update Period Counter"]
#[inline(always)]
pub const fn set_cuprcnt(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 20usize)) | (((val as u32) & 0x0f) << 20usize);
}
}
impl Default for Cmpm {
#[inline(always)]
fn default() -> Cmpm {
Cmpm(0)
}
}
impl core::fmt::Debug for Cmpm {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cmpm")
.field("cen", &self.cen())
.field("ctr", &self.ctr())
.field("cpr", &self.cpr())
.field("cprcnt", &self.cprcnt())
.field("cupr", &self.cupr())
.field("cuprcnt", &self.cuprcnt())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cmpm {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cmpm {{ cen: {=bool:?}, ctr: {=u8:?}, cpr: {=u8:?}, cprcnt: {=u8:?}, cupr: {=u8:?}, cuprcnt: {=u8:?} }}",
self.cen(),
self.ctr(),
self.cpr(),
self.cprcnt(),
self.cupr(),
self.cuprcnt()
)
}
}
#[doc = "PWM Comparison 0 Mode Update Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cmpmupd(pub u32);
impl Cmpmupd {
#[doc = "Comparison x Enable Update"]
#[must_use]
#[inline(always)]
pub const fn cenupd(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Comparison x Enable Update"]
#[inline(always)]
pub const fn set_cenupd(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Comparison x Trigger Update"]
#[must_use]
#[inline(always)]
pub const fn ctrupd(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Trigger Update"]
#[inline(always)]
pub const fn set_ctrupd(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
#[doc = "Comparison x Period Update"]
#[must_use]
#[inline(always)]
pub const fn cprupd(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Period Update"]
#[inline(always)]
pub const fn set_cprupd(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 8usize)) | (((val as u32) & 0x0f) << 8usize);
}
#[doc = "Comparison x Update Period Update"]
#[must_use]
#[inline(always)]
pub const fn cuprupd(&self) -> u8 {
let val = (self.0 >> 16usize) & 0x0f;
val as u8
}
#[doc = "Comparison x Update Period Update"]
#[inline(always)]
pub const fn set_cuprupd(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
}
}
impl Default for Cmpmupd {
#[inline(always)]
fn default() -> Cmpmupd {
Cmpmupd(0)
}
}
impl core::fmt::Debug for Cmpmupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cmpmupd")
.field("cenupd", &self.cenupd())
.field("ctrupd", &self.ctrupd())
.field("cprupd", &self.cprupd())
.field("cuprupd", &self.cuprupd())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cmpmupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cmpmupd {{ cenupd: {=bool:?}, ctrupd: {=u8:?}, cprupd: {=u8:?}, cuprupd: {=u8:?} }}",
self.cenupd(),
self.ctrupd(),
self.cprupd(),
self.cuprupd()
)
}
}
#[doc = "PWM Comparison 0 Value Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cmpv(pub u32);
impl Cmpv {
#[doc = "Comparison x Value"]
#[must_use]
#[inline(always)]
pub const fn cv(&self) -> u32 {
let val = (self.0 >> 0usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Comparison x Value"]
#[inline(always)]
pub const fn set_cv(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
}
#[doc = "Comparison x Value Mode"]
#[must_use]
#[inline(always)]
pub const fn cvm(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Comparison x Value Mode"]
#[inline(always)]
pub const fn set_cvm(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
}
impl Default for Cmpv {
#[inline(always)]
fn default() -> Cmpv {
Cmpv(0)
}
}
impl core::fmt::Debug for Cmpv {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cmpv")
.field("cv", &self.cv())
.field("cvm", &self.cvm())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cmpv {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cmpv {{ cv: {=u32:?}, cvm: {=bool:?} }}",
self.cv(),
self.cvm()
)
}
}
#[doc = "PWM Comparison 0 Value Update Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cmpvupd(pub u32);
impl Cmpvupd {
#[doc = "Comparison x Value Update"]
#[must_use]
#[inline(always)]
pub const fn cvupd(&self) -> u32 {
let val = (self.0 >> 0usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Comparison x Value Update"]
#[inline(always)]
pub const fn set_cvupd(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
}
#[doc = "Comparison x Value Mode Update"]
#[must_use]
#[inline(always)]
pub const fn cvmupd(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Comparison x Value Mode Update"]
#[inline(always)]
pub const fn set_cvmupd(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
}
impl Default for Cmpvupd {
#[inline(always)]
fn default() -> Cmpvupd {
Cmpvupd(0)
}
}
impl core::fmt::Debug for Cmpvupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cmpvupd")
.field("cvupd", &self.cvupd())
.field("cvmupd", &self.cvmupd())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cmpvupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cmpvupd {{ cvupd: {=u32:?}, cvmupd: {=bool:?} }}",
self.cvupd(),
self.cvmupd()
)
}
}
#[doc = "PWM Channel Mode Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cmr(pub u32);
impl Cmr {
#[doc = "Channel Pre-scaler"]
#[must_use]
#[inline(always)]
pub const fn cpre(&self) -> super::vals::CmrCpre {
let val = (self.0 >> 0usize) & 0x0f;
super::vals::CmrCpre::from_bits(val as u8)
}
#[doc = "Channel Pre-scaler"]
#[inline(always)]
pub const fn set_cpre(&mut self, val: super::vals::CmrCpre) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val.to_bits() as u32) & 0x0f) << 0usize);
}
#[doc = "Channel Alignment"]
#[must_use]
#[inline(always)]
pub const fn calg(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Channel Alignment"]
#[inline(always)]
pub const fn set_calg(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Channel Polarity"]
#[must_use]
#[inline(always)]
pub const fn cpol(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Channel Polarity"]
#[inline(always)]
pub const fn set_cpol(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Counter Event Selection"]
#[must_use]
#[inline(always)]
pub const fn ces(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Counter Event Selection"]
#[inline(always)]
pub const fn set_ces(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Dead-Time Generator Enable"]
#[must_use]
#[inline(always)]
pub const fn dte(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Dead-Time Generator Enable"]
#[inline(always)]
pub const fn set_dte(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Dead-Time PWMHx Output Inverted"]
#[must_use]
#[inline(always)]
pub const fn dthi(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Dead-Time PWMHx Output Inverted"]
#[inline(always)]
pub const fn set_dthi(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Dead-Time PWMLx Output Inverted"]
#[must_use]
#[inline(always)]
pub const fn dtli(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Dead-Time PWMLx Output Inverted"]
#[inline(always)]
pub const fn set_dtli(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
}
impl Default for Cmr {
#[inline(always)]
fn default() -> Cmr {
Cmr(0)
}
}
impl core::fmt::Debug for Cmr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cmr")
.field("cpre", &self.cpre())
.field("calg", &self.calg())
.field("cpol", &self.cpol())
.field("ces", &self.ces())
.field("dte", &self.dte())
.field("dthi", &self.dthi())
.field("dtli", &self.dtli())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cmr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cmr {{ cpre: {:?}, calg: {=bool:?}, cpol: {=bool:?}, ces: {=bool:?}, dte: {=bool:?}, dthi: {=bool:?}, dtli: {=bool:?} }}",
self.cpre(),
self.calg(),
self.cpol(),
self.ces(),
self.dte(),
self.dthi(),
self.dtli()
)
}
}
#[doc = "PWM Channel Period Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cprd(pub u32);
impl Cprd {
#[doc = "Channel Period"]
#[must_use]
#[inline(always)]
pub const fn cprd(&self) -> u32 {
let val = (self.0 >> 0usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Channel Period"]
#[inline(always)]
pub const fn set_cprd(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
}
}
impl Default for Cprd {
#[inline(always)]
fn default() -> Cprd {
Cprd(0)
}
}
impl core::fmt::Debug for Cprd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cprd").field("cprd", &self.cprd()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cprd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Cprd {{ cprd: {=u32:?} }}", self.cprd())
}
}
#[doc = "PWM Channel Period Update Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cprdupd(pub u32);
impl Cprdupd {
#[doc = "Channel Period Update"]
#[must_use]
#[inline(always)]
pub const fn cprdupd(&self) -> u32 {
let val = (self.0 >> 0usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Channel Period Update"]
#[inline(always)]
pub const fn set_cprdupd(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
}
}
impl Default for Cprdupd {
#[inline(always)]
fn default() -> Cprdupd {
Cprdupd(0)
}
}
impl core::fmt::Debug for Cprdupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cprdupd")
.field("cprdupd", &self.cprdupd())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cprdupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Cprdupd {{ cprdupd: {=u32:?} }}", self.cprdupd())
}
}
#[doc = "PWM Disable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Dis(pub u32);
impl Dis {
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Dis {
#[inline(always)]
fn default() -> Dis {
Dis(0)
}
}
impl core::fmt::Debug for Dis {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Dis")
.field("chid0", &self.chid0())
.field("chid1", &self.chid1())
.field("chid2", &self.chid2())
.field("chid3", &self.chid3())
.field("chid4", &self.chid4())
.field("chid5", &self.chid5())
.field("chid6", &self.chid6())
.field("chid7", &self.chid7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Dis {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Dis {{ chid0: {=bool:?}, chid1: {=bool:?}, chid2: {=bool:?}, chid3: {=bool:?}, chid4: {=bool:?}, chid5: {=bool:?}, chid6: {=bool:?}, chid7: {=bool:?} }}",
self.chid0(),
self.chid1(),
self.chid2(),
self.chid3(),
self.chid4(),
self.chid5(),
self.chid6(),
self.chid7()
)
}
}
#[doc = "PWM Channel Dead Time Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Dt(pub u32);
impl Dt {
#[doc = "Dead-Time Value for PWMHx Output"]
#[must_use]
#[inline(always)]
pub const fn dth(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Dead-Time Value for PWMHx Output"]
#[inline(always)]
pub const fn set_dth(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
#[doc = "Dead-Time Value for PWMLx Output"]
#[must_use]
#[inline(always)]
pub const fn dtl(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Dead-Time Value for PWMLx Output"]
#[inline(always)]
pub const fn set_dtl(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Dt {
#[inline(always)]
fn default() -> Dt {
Dt(0)
}
}
impl core::fmt::Debug for Dt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Dt")
.field("dth", &self.dth())
.field("dtl", &self.dtl())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Dt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Dt {{ dth: {=u16:?}, dtl: {=u16:?} }}",
self.dth(),
self.dtl()
)
}
}
#[doc = "PWM Channel Dead Time Update Register (ch_num = 0)"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Dtupd(pub u32);
impl Dtupd {
#[doc = "Dead-Time Value Update for PWMHx Output"]
#[must_use]
#[inline(always)]
pub const fn dthupd(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Dead-Time Value Update for PWMHx Output"]
#[inline(always)]
pub const fn set_dthupd(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
#[doc = "Dead-Time Value Update for PWMLx Output"]
#[must_use]
#[inline(always)]
pub const fn dtlupd(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Dead-Time Value Update for PWMLx Output"]
#[inline(always)]
pub const fn set_dtlupd(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Dtupd {
#[inline(always)]
fn default() -> Dtupd {
Dtupd(0)
}
}
impl core::fmt::Debug for Dtupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Dtupd")
.field("dthupd", &self.dthupd())
.field("dtlupd", &self.dtlupd())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Dtupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Dtupd {{ dthupd: {=u16:?}, dtlupd: {=u16:?} }}",
self.dthupd(),
self.dtlupd()
)
}
}
#[doc = "PWM Event Line 0 Mode Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Elmr(pub u32);
impl Elmr {
#[doc = "Comparison 0 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Selection"]
#[inline(always)]
pub const fn set_csel0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Comparison 1 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Selection"]
#[inline(always)]
pub const fn set_csel1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Comparison 2 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Selection"]
#[inline(always)]
pub const fn set_csel2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Comparison 3 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Selection"]
#[inline(always)]
pub const fn set_csel3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Comparison 4 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Selection"]
#[inline(always)]
pub const fn set_csel4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Comparison 5 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Selection"]
#[inline(always)]
pub const fn set_csel5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Comparison 6 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Selection"]
#[inline(always)]
pub const fn set_csel6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Comparison 7 Selection"]
#[must_use]
#[inline(always)]
pub const fn csel7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Selection"]
#[inline(always)]
pub const fn set_csel7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Elmr {
#[inline(always)]
fn default() -> Elmr {
Elmr(0)
}
}
impl core::fmt::Debug for Elmr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Elmr")
.field("csel0", &self.csel0())
.field("csel1", &self.csel1())
.field("csel2", &self.csel2())
.field("csel3", &self.csel3())
.field("csel4", &self.csel4())
.field("csel5", &self.csel5())
.field("csel6", &self.csel6())
.field("csel7", &self.csel7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Elmr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Elmr {{ csel0: {=bool:?}, csel1: {=bool:?}, csel2: {=bool:?}, csel3: {=bool:?}, csel4: {=bool:?}, csel5: {=bool:?}, csel6: {=bool:?}, csel7: {=bool:?} }}",
self.csel0(),
self.csel1(),
self.csel2(),
self.csel3(),
self.csel4(),
self.csel5(),
self.csel6(),
self.csel7()
)
}
}
#[doc = "PWM Enable Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ena(pub u32);
impl Ena {
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid(&self, n: usize) -> bool {
assert!(n < 8usize);
let offs = 0usize + n * 1usize;
let val = (self.0 >> offs) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid(&mut self, n: usize, val: bool) {
assert!(n < 8usize);
let offs = 0usize + n * 1usize;
self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
}
}
impl Default for Ena {
#[inline(always)]
fn default() -> Ena {
Ena(0)
}
}
impl core::fmt::Debug for Ena {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ena")
.field("chid[0]", &self.chid(0usize))
.field("chid[1]", &self.chid(1usize))
.field("chid[2]", &self.chid(2usize))
.field("chid[3]", &self.chid(3usize))
.field("chid[4]", &self.chid(4usize))
.field("chid[5]", &self.chid(5usize))
.field("chid[6]", &self.chid(6usize))
.field("chid[7]", &self.chid(7usize))
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ena {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ena {{ chid[0]: {=bool:?}, chid[1]: {=bool:?}, chid[2]: {=bool:?}, chid[3]: {=bool:?}, chid[4]: {=bool:?}, chid[5]: {=bool:?}, chid[6]: {=bool:?}, chid[7]: {=bool:?} }}",
self.chid(0usize),
self.chid(1usize),
self.chid(2usize),
self.chid(3usize),
self.chid(4usize),
self.chid(5usize),
self.chid(6usize),
self.chid(7usize)
)
}
}
#[doc = "PWM Fault Clear Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Fcr(pub u32);
impl Fcr {
#[doc = "Fault Clear (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fclr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "Fault Clear (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fclr(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
}
impl Default for Fcr {
#[inline(always)]
fn default() -> Fcr {
Fcr(0)
}
}
impl core::fmt::Debug for Fcr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Fcr").field("fclr", &self.fclr()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Fcr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Fcr {{ fclr: {=u8:?} }}", self.fclr())
}
}
#[doc = "PWM Fault Mode Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Fmr(pub u32);
impl Fmr {
#[doc = "Fault Polarity (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpol(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "Fault Polarity (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpol(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
#[doc = "Fault Activation Mode (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fmod(&self) -> u8 {
let val = (self.0 >> 8usize) & 0xff;
val as u8
}
#[doc = "Fault Activation Mode (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fmod(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
}
#[doc = "Fault Filtering (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn ffil(&self) -> u8 {
let val = (self.0 >> 16usize) & 0xff;
val as u8
}
#[doc = "Fault Filtering (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_ffil(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
}
}
impl Default for Fmr {
#[inline(always)]
fn default() -> Fmr {
Fmr(0)
}
}
impl core::fmt::Debug for Fmr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Fmr")
.field("fpol", &self.fpol())
.field("fmod", &self.fmod())
.field("ffil", &self.ffil())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Fmr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Fmr {{ fpol: {=u8:?}, fmod: {=u8:?}, ffil: {=u8:?} }}",
self.fpol(),
self.fmod(),
self.ffil()
)
}
}
#[doc = "PWM Fault Protection Enable Register 1"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Fpe1(pub u32);
impl Fpe1 {
#[doc = "Fault Protection Enable for channel 0 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe0(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 0 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe0(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
#[doc = "Fault Protection Enable for channel 1 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe1(&self) -> u8 {
let val = (self.0 >> 8usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 1 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe1(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
}
#[doc = "Fault Protection Enable for channel 2 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe2(&self) -> u8 {
let val = (self.0 >> 16usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 2 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe2(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
}
#[doc = "Fault Protection Enable for channel 3 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe3(&self) -> u8 {
let val = (self.0 >> 24usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 3 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe3(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
}
}
impl Default for Fpe1 {
#[inline(always)]
fn default() -> Fpe1 {
Fpe1(0)
}
}
impl core::fmt::Debug for Fpe1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Fpe1")
.field("fpe0", &self.fpe0())
.field("fpe1", &self.fpe1())
.field("fpe2", &self.fpe2())
.field("fpe3", &self.fpe3())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Fpe1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Fpe1 {{ fpe0: {=u8:?}, fpe1: {=u8:?}, fpe2: {=u8:?}, fpe3: {=u8:?} }}",
self.fpe0(),
self.fpe1(),
self.fpe2(),
self.fpe3()
)
}
}
#[doc = "PWM Fault Protection Enable Register 2"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Fpe2(pub u32);
impl Fpe2 {
#[doc = "Fault Protection Enable for channel 4 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe4(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 4 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe4(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
#[doc = "Fault Protection Enable for channel 5 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe5(&self) -> u8 {
let val = (self.0 >> 8usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 5 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe5(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
}
#[doc = "Fault Protection Enable for channel 6 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe6(&self) -> u8 {
let val = (self.0 >> 16usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 6 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe6(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
}
#[doc = "Fault Protection Enable for channel 7 (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fpe7(&self) -> u8 {
let val = (self.0 >> 24usize) & 0xff;
val as u8
}
#[doc = "Fault Protection Enable for channel 7 (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fpe7(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
}
}
impl Default for Fpe2 {
#[inline(always)]
fn default() -> Fpe2 {
Fpe2(0)
}
}
impl core::fmt::Debug for Fpe2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Fpe2")
.field("fpe4", &self.fpe4())
.field("fpe5", &self.fpe5())
.field("fpe6", &self.fpe6())
.field("fpe7", &self.fpe7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Fpe2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Fpe2 {{ fpe4: {=u8:?}, fpe5: {=u8:?}, fpe6: {=u8:?}, fpe7: {=u8:?} }}",
self.fpe4(),
self.fpe5(),
self.fpe6(),
self.fpe7()
)
}
}
#[doc = "PWM Fault Protection Value Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Fpv(pub u32);
impl Fpv {
#[doc = "Fault Protection Value for PWMH output on channel 0"]
#[must_use]
#[inline(always)]
pub const fn fpvh0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 0"]
#[inline(always)]
pub const fn set_fpvh0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Fault Protection Value for PWMH output on channel 1"]
#[must_use]
#[inline(always)]
pub const fn fpvh1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 1"]
#[inline(always)]
pub const fn set_fpvh1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Fault Protection Value for PWMH output on channel 2"]
#[must_use]
#[inline(always)]
pub const fn fpvh2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 2"]
#[inline(always)]
pub const fn set_fpvh2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Fault Protection Value for PWMH output on channel 3"]
#[must_use]
#[inline(always)]
pub const fn fpvh3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 3"]
#[inline(always)]
pub const fn set_fpvh3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Fault Protection Value for PWMH output on channel 4"]
#[must_use]
#[inline(always)]
pub const fn fpvh4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 4"]
#[inline(always)]
pub const fn set_fpvh4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Fault Protection Value for PWMH output on channel 5"]
#[must_use]
#[inline(always)]
pub const fn fpvh5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 5"]
#[inline(always)]
pub const fn set_fpvh5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Fault Protection Value for PWMH output on channel 6"]
#[must_use]
#[inline(always)]
pub const fn fpvh6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 6"]
#[inline(always)]
pub const fn set_fpvh6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Fault Protection Value for PWMH output on channel 7"]
#[must_use]
#[inline(always)]
pub const fn fpvh7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWMH output on channel 7"]
#[inline(always)]
pub const fn set_fpvh7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Fault Protection Value for PWML output on channel 0"]
#[must_use]
#[inline(always)]
pub const fn fpvl0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 0"]
#[inline(always)]
pub const fn set_fpvl0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Fault Protection Value for PWML output on channel 1"]
#[must_use]
#[inline(always)]
pub const fn fpvl1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 1"]
#[inline(always)]
pub const fn set_fpvl1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Fault Protection Value for PWML output on channel 2"]
#[must_use]
#[inline(always)]
pub const fn fpvl2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 2"]
#[inline(always)]
pub const fn set_fpvl2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Fault Protection Value for PWML output on channel 3"]
#[must_use]
#[inline(always)]
pub const fn fpvl3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 3"]
#[inline(always)]
pub const fn set_fpvl3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Fault Protection Value for PWML output on channel 4"]
#[must_use]
#[inline(always)]
pub const fn fpvl4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 4"]
#[inline(always)]
pub const fn set_fpvl4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Fault Protection Value for PWML output on channel 5"]
#[must_use]
#[inline(always)]
pub const fn fpvl5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 5"]
#[inline(always)]
pub const fn set_fpvl5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Fault Protection Value for PWML output on channel 6"]
#[must_use]
#[inline(always)]
pub const fn fpvl6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 6"]
#[inline(always)]
pub const fn set_fpvl6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Fault Protection Value for PWML output on channel 7"]
#[must_use]
#[inline(always)]
pub const fn fpvl7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Value for PWML output on channel 7"]
#[inline(always)]
pub const fn set_fpvl7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Fpv {
#[inline(always)]
fn default() -> Fpv {
Fpv(0)
}
}
impl core::fmt::Debug for Fpv {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Fpv")
.field("fpvh0", &self.fpvh0())
.field("fpvh1", &self.fpvh1())
.field("fpvh2", &self.fpvh2())
.field("fpvh3", &self.fpvh3())
.field("fpvh4", &self.fpvh4())
.field("fpvh5", &self.fpvh5())
.field("fpvh6", &self.fpvh6())
.field("fpvh7", &self.fpvh7())
.field("fpvl0", &self.fpvl0())
.field("fpvl1", &self.fpvl1())
.field("fpvl2", &self.fpvl2())
.field("fpvl3", &self.fpvl3())
.field("fpvl4", &self.fpvl4())
.field("fpvl5", &self.fpvl5())
.field("fpvl6", &self.fpvl6())
.field("fpvl7", &self.fpvl7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Fpv {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Fpv {{ fpvh0: {=bool:?}, fpvh1: {=bool:?}, fpvh2: {=bool:?}, fpvh3: {=bool:?}, fpvh4: {=bool:?}, fpvh5: {=bool:?}, fpvh6: {=bool:?}, fpvh7: {=bool:?}, fpvl0: {=bool:?}, fpvl1: {=bool:?}, fpvl2: {=bool:?}, fpvl3: {=bool:?}, fpvl4: {=bool:?}, fpvl5: {=bool:?}, fpvl6: {=bool:?}, fpvl7: {=bool:?} }}",
self.fpvh0(),
self.fpvh1(),
self.fpvh2(),
self.fpvh3(),
self.fpvh4(),
self.fpvh5(),
self.fpvh6(),
self.fpvh7(),
self.fpvl0(),
self.fpvl1(),
self.fpvl2(),
self.fpvl3(),
self.fpvl4(),
self.fpvl5(),
self.fpvl6(),
self.fpvl7()
)
}
}
#[doc = "PWM Fault Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Fsr(pub u32);
impl Fsr {
#[doc = "Fault Input Value (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fiv(&self) -> u8 {
let val = (self.0 >> 0usize) & 0xff;
val as u8
}
#[doc = "Fault Input Value (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fiv(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
}
#[doc = "Fault Status (fault input bit varies from 0 to 5)"]
#[must_use]
#[inline(always)]
pub const fn fs(&self) -> u8 {
let val = (self.0 >> 8usize) & 0xff;
val as u8
}
#[doc = "Fault Status (fault input bit varies from 0 to 5)"]
#[inline(always)]
pub const fn set_fs(&mut self, val: u8) {
self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
}
}
impl Default for Fsr {
#[inline(always)]
fn default() -> Fsr {
Fsr(0)
}
}
impl core::fmt::Debug for Fsr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Fsr")
.field("fiv", &self.fiv())
.field("fs", &self.fs())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Fsr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Fsr {{ fiv: {=u8:?}, fs: {=u8:?} }}",
self.fiv(),
self.fs()
)
}
}
#[doc = "PWM Interrupt Disable Register 1"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Idr1(pub u32);
impl Idr1 {
#[doc = "Counter Event on Channel 0 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 0 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Counter Event on Channel 1 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 1 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Counter Event on Channel 2 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 2 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Counter Event on Channel 3 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 3 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Counter Event on Channel 4 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 4 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Counter Event on Channel 5 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 5 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Counter Event on Channel 6 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 6 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Counter Event on Channel 7 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn chid7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 7 Interrupt Disable"]
#[inline(always)]
pub const fn set_chid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Fault Protection Trigger on Channel 0 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 0 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Fault Protection Trigger on Channel 1 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 1 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Fault Protection Trigger on Channel 2 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 2 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Fault Protection Trigger on Channel 3 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 3 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Fault Protection Trigger on Channel 4 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 4 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Fault Protection Trigger on Channel 5 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 5 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Fault Protection Trigger on Channel 6 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 6 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Fault Protection Trigger on Channel 7 Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn fchid7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 7 Interrupt Disable"]
#[inline(always)]
pub const fn set_fchid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Idr1 {
#[inline(always)]
fn default() -> Idr1 {
Idr1(0)
}
}
impl core::fmt::Debug for Idr1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Idr1")
.field("chid0", &self.chid0())
.field("chid1", &self.chid1())
.field("chid2", &self.chid2())
.field("chid3", &self.chid3())
.field("chid4", &self.chid4())
.field("chid5", &self.chid5())
.field("chid6", &self.chid6())
.field("chid7", &self.chid7())
.field("fchid0", &self.fchid0())
.field("fchid1", &self.fchid1())
.field("fchid2", &self.fchid2())
.field("fchid3", &self.fchid3())
.field("fchid4", &self.fchid4())
.field("fchid5", &self.fchid5())
.field("fchid6", &self.fchid6())
.field("fchid7", &self.fchid7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Idr1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Idr1 {{ chid0: {=bool:?}, chid1: {=bool:?}, chid2: {=bool:?}, chid3: {=bool:?}, chid4: {=bool:?}, chid5: {=bool:?}, chid6: {=bool:?}, chid7: {=bool:?}, fchid0: {=bool:?}, fchid1: {=bool:?}, fchid2: {=bool:?}, fchid3: {=bool:?}, fchid4: {=bool:?}, fchid5: {=bool:?}, fchid6: {=bool:?}, fchid7: {=bool:?} }}",
self.chid0(),
self.chid1(),
self.chid2(),
self.chid3(),
self.chid4(),
self.chid5(),
self.chid6(),
self.chid7(),
self.fchid0(),
self.fchid1(),
self.fchid2(),
self.fchid3(),
self.fchid4(),
self.fchid5(),
self.fchid6(),
self.fchid7()
)
}
}
#[doc = "PWM Interrupt Disable Register 2"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Idr2(pub u32);
impl Idr2 {
#[doc = "Write Ready for Synchronous Channels Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn wrdy(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Write Ready for Synchronous Channels Update Interrupt Disable"]
#[inline(always)]
pub const fn set_wrdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "PDC End of TX Buffer Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn endtx(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "PDC End of TX Buffer Interrupt Disable"]
#[inline(always)]
pub const fn set_endtx(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "PDC TX Buffer Empty Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn txbufe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "PDC TX Buffer Empty Interrupt Disable"]
#[inline(always)]
pub const fn set_txbufe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Synchronous Channels Update Underrun Error Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn unre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Synchronous Channels Update Underrun Error Interrupt Disable"]
#[inline(always)]
pub const fn set_unre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Comparison 0 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Comparison 1 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Comparison 2 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Comparison 3 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Comparison 4 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Comparison 5 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Comparison 6 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Comparison 7 Match Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpm7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Match Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpm7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Comparison 0 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Comparison 1 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Comparison 2 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Comparison 3 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Comparison 4 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Comparison 5 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Comparison 6 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Comparison 7 Update Interrupt Disable"]
#[must_use]
#[inline(always)]
pub const fn cmpu7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Update Interrupt Disable"]
#[inline(always)]
pub const fn set_cmpu7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Idr2 {
#[inline(always)]
fn default() -> Idr2 {
Idr2(0)
}
}
impl core::fmt::Debug for Idr2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Idr2")
.field("wrdy", &self.wrdy())
.field("endtx", &self.endtx())
.field("txbufe", &self.txbufe())
.field("unre", &self.unre())
.field("cmpm0", &self.cmpm0())
.field("cmpm1", &self.cmpm1())
.field("cmpm2", &self.cmpm2())
.field("cmpm3", &self.cmpm3())
.field("cmpm4", &self.cmpm4())
.field("cmpm5", &self.cmpm5())
.field("cmpm6", &self.cmpm6())
.field("cmpm7", &self.cmpm7())
.field("cmpu0", &self.cmpu0())
.field("cmpu1", &self.cmpu1())
.field("cmpu2", &self.cmpu2())
.field("cmpu3", &self.cmpu3())
.field("cmpu4", &self.cmpu4())
.field("cmpu5", &self.cmpu5())
.field("cmpu6", &self.cmpu6())
.field("cmpu7", &self.cmpu7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Idr2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Idr2 {{ wrdy: {=bool:?}, endtx: {=bool:?}, txbufe: {=bool:?}, unre: {=bool:?}, cmpm0: {=bool:?}, cmpm1: {=bool:?}, cmpm2: {=bool:?}, cmpm3: {=bool:?}, cmpm4: {=bool:?}, cmpm5: {=bool:?}, cmpm6: {=bool:?}, cmpm7: {=bool:?}, cmpu0: {=bool:?}, cmpu1: {=bool:?}, cmpu2: {=bool:?}, cmpu3: {=bool:?}, cmpu4: {=bool:?}, cmpu5: {=bool:?}, cmpu6: {=bool:?}, cmpu7: {=bool:?} }}",
self.wrdy(),
self.endtx(),
self.txbufe(),
self.unre(),
self.cmpm0(),
self.cmpm1(),
self.cmpm2(),
self.cmpm3(),
self.cmpm4(),
self.cmpm5(),
self.cmpm6(),
self.cmpm7(),
self.cmpu0(),
self.cmpu1(),
self.cmpu2(),
self.cmpu3(),
self.cmpu4(),
self.cmpu5(),
self.cmpu6(),
self.cmpu7()
)
}
}
#[doc = "PWM Interrupt Enable Register 1"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ier1(pub u32);
impl Ier1 {
#[doc = "Counter Event on Channel 0 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 0 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Counter Event on Channel 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Counter Event on Channel 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Counter Event on Channel 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Counter Event on Channel 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Counter Event on Channel 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Counter Event on Channel 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Counter Event on Channel 7 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn chid7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 7 Interrupt Enable"]
#[inline(always)]
pub const fn set_chid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Fault Protection Trigger on Channel 0 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 0 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Fault Protection Trigger on Channel 1 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 1 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Fault Protection Trigger on Channel 2 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 2 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Fault Protection Trigger on Channel 3 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 3 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Fault Protection Trigger on Channel 4 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 4 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Fault Protection Trigger on Channel 5 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 5 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Fault Protection Trigger on Channel 6 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 6 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Fault Protection Trigger on Channel 7 Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn fchid7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 7 Interrupt Enable"]
#[inline(always)]
pub const fn set_fchid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Ier1 {
#[inline(always)]
fn default() -> Ier1 {
Ier1(0)
}
}
impl core::fmt::Debug for Ier1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ier1")
.field("chid0", &self.chid0())
.field("chid1", &self.chid1())
.field("chid2", &self.chid2())
.field("chid3", &self.chid3())
.field("chid4", &self.chid4())
.field("chid5", &self.chid5())
.field("chid6", &self.chid6())
.field("chid7", &self.chid7())
.field("fchid0", &self.fchid0())
.field("fchid1", &self.fchid1())
.field("fchid2", &self.fchid2())
.field("fchid3", &self.fchid3())
.field("fchid4", &self.fchid4())
.field("fchid5", &self.fchid5())
.field("fchid6", &self.fchid6())
.field("fchid7", &self.fchid7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ier1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ier1 {{ chid0: {=bool:?}, chid1: {=bool:?}, chid2: {=bool:?}, chid3: {=bool:?}, chid4: {=bool:?}, chid5: {=bool:?}, chid6: {=bool:?}, chid7: {=bool:?}, fchid0: {=bool:?}, fchid1: {=bool:?}, fchid2: {=bool:?}, fchid3: {=bool:?}, fchid4: {=bool:?}, fchid5: {=bool:?}, fchid6: {=bool:?}, fchid7: {=bool:?} }}",
self.chid0(),
self.chid1(),
self.chid2(),
self.chid3(),
self.chid4(),
self.chid5(),
self.chid6(),
self.chid7(),
self.fchid0(),
self.fchid1(),
self.fchid2(),
self.fchid3(),
self.fchid4(),
self.fchid5(),
self.fchid6(),
self.fchid7()
)
}
}
#[doc = "PWM Interrupt Enable Register 2"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ier2(pub u32);
impl Ier2 {
#[doc = "Write Ready for Synchronous Channels Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn wrdy(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Write Ready for Synchronous Channels Update Interrupt Enable"]
#[inline(always)]
pub const fn set_wrdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "PDC End of TX Buffer Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn endtx(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "PDC End of TX Buffer Interrupt Enable"]
#[inline(always)]
pub const fn set_endtx(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "PDC TX Buffer Empty Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn txbufe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "PDC TX Buffer Empty Interrupt Enable"]
#[inline(always)]
pub const fn set_txbufe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Synchronous Channels Update Underrun Error Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn unre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Synchronous Channels Update Underrun Error Interrupt Enable"]
#[inline(always)]
pub const fn set_unre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Comparison 0 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Comparison 1 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Comparison 2 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Comparison 3 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Comparison 4 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Comparison 5 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Comparison 6 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Comparison 7 Match Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpm7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Match Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpm7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Comparison 0 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Comparison 1 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Comparison 2 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Comparison 3 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Comparison 4 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Comparison 5 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Comparison 6 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Comparison 7 Update Interrupt Enable"]
#[must_use]
#[inline(always)]
pub const fn cmpu7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Update Interrupt Enable"]
#[inline(always)]
pub const fn set_cmpu7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Ier2 {
#[inline(always)]
fn default() -> Ier2 {
Ier2(0)
}
}
impl core::fmt::Debug for Ier2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ier2")
.field("wrdy", &self.wrdy())
.field("endtx", &self.endtx())
.field("txbufe", &self.txbufe())
.field("unre", &self.unre())
.field("cmpm0", &self.cmpm0())
.field("cmpm1", &self.cmpm1())
.field("cmpm2", &self.cmpm2())
.field("cmpm3", &self.cmpm3())
.field("cmpm4", &self.cmpm4())
.field("cmpm5", &self.cmpm5())
.field("cmpm6", &self.cmpm6())
.field("cmpm7", &self.cmpm7())
.field("cmpu0", &self.cmpu0())
.field("cmpu1", &self.cmpu1())
.field("cmpu2", &self.cmpu2())
.field("cmpu3", &self.cmpu3())
.field("cmpu4", &self.cmpu4())
.field("cmpu5", &self.cmpu5())
.field("cmpu6", &self.cmpu6())
.field("cmpu7", &self.cmpu7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ier2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ier2 {{ wrdy: {=bool:?}, endtx: {=bool:?}, txbufe: {=bool:?}, unre: {=bool:?}, cmpm0: {=bool:?}, cmpm1: {=bool:?}, cmpm2: {=bool:?}, cmpm3: {=bool:?}, cmpm4: {=bool:?}, cmpm5: {=bool:?}, cmpm6: {=bool:?}, cmpm7: {=bool:?}, cmpu0: {=bool:?}, cmpu1: {=bool:?}, cmpu2: {=bool:?}, cmpu3: {=bool:?}, cmpu4: {=bool:?}, cmpu5: {=bool:?}, cmpu6: {=bool:?}, cmpu7: {=bool:?} }}",
self.wrdy(),
self.endtx(),
self.txbufe(),
self.unre(),
self.cmpm0(),
self.cmpm1(),
self.cmpm2(),
self.cmpm3(),
self.cmpm4(),
self.cmpm5(),
self.cmpm6(),
self.cmpm7(),
self.cmpu0(),
self.cmpu1(),
self.cmpu2(),
self.cmpu3(),
self.cmpu4(),
self.cmpu5(),
self.cmpu6(),
self.cmpu7()
)
}
}
#[doc = "PWM Interrupt Mask Register 1"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Imr1(pub u32);
impl Imr1 {
#[doc = "Counter Event on Channel 0 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 0 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Counter Event on Channel 1 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 1 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Counter Event on Channel 2 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 2 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Counter Event on Channel 3 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 3 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Counter Event on Channel 4 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 4 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Counter Event on Channel 5 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 5 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Counter Event on Channel 6 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 6 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Counter Event on Channel 7 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn chid7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 7 Interrupt Mask"]
#[inline(always)]
pub const fn set_chid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Fault Protection Trigger on Channel 0 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 0 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Fault Protection Trigger on Channel 1 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 1 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Fault Protection Trigger on Channel 2 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 2 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Fault Protection Trigger on Channel 3 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 3 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Fault Protection Trigger on Channel 4 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 4 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Fault Protection Trigger on Channel 5 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 5 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Fault Protection Trigger on Channel 6 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 6 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Fault Protection Trigger on Channel 7 Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn fchid7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 7 Interrupt Mask"]
#[inline(always)]
pub const fn set_fchid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Imr1 {
#[inline(always)]
fn default() -> Imr1 {
Imr1(0)
}
}
impl core::fmt::Debug for Imr1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Imr1")
.field("chid0", &self.chid0())
.field("chid1", &self.chid1())
.field("chid2", &self.chid2())
.field("chid3", &self.chid3())
.field("chid4", &self.chid4())
.field("chid5", &self.chid5())
.field("chid6", &self.chid6())
.field("chid7", &self.chid7())
.field("fchid0", &self.fchid0())
.field("fchid1", &self.fchid1())
.field("fchid2", &self.fchid2())
.field("fchid3", &self.fchid3())
.field("fchid4", &self.fchid4())
.field("fchid5", &self.fchid5())
.field("fchid6", &self.fchid6())
.field("fchid7", &self.fchid7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Imr1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Imr1 {{ chid0: {=bool:?}, chid1: {=bool:?}, chid2: {=bool:?}, chid3: {=bool:?}, chid4: {=bool:?}, chid5: {=bool:?}, chid6: {=bool:?}, chid7: {=bool:?}, fchid0: {=bool:?}, fchid1: {=bool:?}, fchid2: {=bool:?}, fchid3: {=bool:?}, fchid4: {=bool:?}, fchid5: {=bool:?}, fchid6: {=bool:?}, fchid7: {=bool:?} }}",
self.chid0(),
self.chid1(),
self.chid2(),
self.chid3(),
self.chid4(),
self.chid5(),
self.chid6(),
self.chid7(),
self.fchid0(),
self.fchid1(),
self.fchid2(),
self.fchid3(),
self.fchid4(),
self.fchid5(),
self.fchid6(),
self.fchid7()
)
}
}
#[doc = "PWM Interrupt Mask Register 2"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Imr2(pub u32);
impl Imr2 {
#[doc = "Write Ready for Synchronous Channels Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn wrdy(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Write Ready for Synchronous Channels Update Interrupt Mask"]
#[inline(always)]
pub const fn set_wrdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "PDC End of TX Buffer Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn endtx(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "PDC End of TX Buffer Interrupt Mask"]
#[inline(always)]
pub const fn set_endtx(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "PDC TX Buffer Empty Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn txbufe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "PDC TX Buffer Empty Interrupt Mask"]
#[inline(always)]
pub const fn set_txbufe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Synchronous Channels Update Underrun Error Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn unre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Synchronous Channels Update Underrun Error Interrupt Mask"]
#[inline(always)]
pub const fn set_unre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Comparison 0 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Comparison 1 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Comparison 2 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Comparison 3 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Comparison 4 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Comparison 5 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Comparison 6 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Comparison 7 Match Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpm7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Match Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpm7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Comparison 0 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Comparison 1 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Comparison 2 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Comparison 3 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Comparison 4 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Comparison 5 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Comparison 6 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Comparison 7 Update Interrupt Mask"]
#[must_use]
#[inline(always)]
pub const fn cmpu7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Update Interrupt Mask"]
#[inline(always)]
pub const fn set_cmpu7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Imr2 {
#[inline(always)]
fn default() -> Imr2 {
Imr2(0)
}
}
impl core::fmt::Debug for Imr2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Imr2")
.field("wrdy", &self.wrdy())
.field("endtx", &self.endtx())
.field("txbufe", &self.txbufe())
.field("unre", &self.unre())
.field("cmpm0", &self.cmpm0())
.field("cmpm1", &self.cmpm1())
.field("cmpm2", &self.cmpm2())
.field("cmpm3", &self.cmpm3())
.field("cmpm4", &self.cmpm4())
.field("cmpm5", &self.cmpm5())
.field("cmpm6", &self.cmpm6())
.field("cmpm7", &self.cmpm7())
.field("cmpu0", &self.cmpu0())
.field("cmpu1", &self.cmpu1())
.field("cmpu2", &self.cmpu2())
.field("cmpu3", &self.cmpu3())
.field("cmpu4", &self.cmpu4())
.field("cmpu5", &self.cmpu5())
.field("cmpu6", &self.cmpu6())
.field("cmpu7", &self.cmpu7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Imr2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Imr2 {{ wrdy: {=bool:?}, endtx: {=bool:?}, txbufe: {=bool:?}, unre: {=bool:?}, cmpm0: {=bool:?}, cmpm1: {=bool:?}, cmpm2: {=bool:?}, cmpm3: {=bool:?}, cmpm4: {=bool:?}, cmpm5: {=bool:?}, cmpm6: {=bool:?}, cmpm7: {=bool:?}, cmpu0: {=bool:?}, cmpu1: {=bool:?}, cmpu2: {=bool:?}, cmpu3: {=bool:?}, cmpu4: {=bool:?}, cmpu5: {=bool:?}, cmpu6: {=bool:?}, cmpu7: {=bool:?} }}",
self.wrdy(),
self.endtx(),
self.txbufe(),
self.unre(),
self.cmpm0(),
self.cmpm1(),
self.cmpm2(),
self.cmpm3(),
self.cmpm4(),
self.cmpm5(),
self.cmpm6(),
self.cmpm7(),
self.cmpu0(),
self.cmpu1(),
self.cmpu2(),
self.cmpu3(),
self.cmpu4(),
self.cmpu5(),
self.cmpu6(),
self.cmpu7()
)
}
}
#[doc = "PWM Interrupt Status Register 1"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Isr1(pub u32);
impl Isr1 {
#[doc = "Counter Event on Channel 0"]
#[must_use]
#[inline(always)]
pub const fn chid0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 0"]
#[inline(always)]
pub const fn set_chid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Counter Event on Channel 1"]
#[must_use]
#[inline(always)]
pub const fn chid1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 1"]
#[inline(always)]
pub const fn set_chid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Counter Event on Channel 2"]
#[must_use]
#[inline(always)]
pub const fn chid2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 2"]
#[inline(always)]
pub const fn set_chid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Counter Event on Channel 3"]
#[must_use]
#[inline(always)]
pub const fn chid3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 3"]
#[inline(always)]
pub const fn set_chid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Counter Event on Channel 4"]
#[must_use]
#[inline(always)]
pub const fn chid4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 4"]
#[inline(always)]
pub const fn set_chid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Counter Event on Channel 5"]
#[must_use]
#[inline(always)]
pub const fn chid5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 5"]
#[inline(always)]
pub const fn set_chid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Counter Event on Channel 6"]
#[must_use]
#[inline(always)]
pub const fn chid6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 6"]
#[inline(always)]
pub const fn set_chid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Counter Event on Channel 7"]
#[must_use]
#[inline(always)]
pub const fn chid7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Counter Event on Channel 7"]
#[inline(always)]
pub const fn set_chid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Fault Protection Trigger on Channel 0"]
#[must_use]
#[inline(always)]
pub const fn fchid0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 0"]
#[inline(always)]
pub const fn set_fchid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Fault Protection Trigger on Channel 1"]
#[must_use]
#[inline(always)]
pub const fn fchid1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 1"]
#[inline(always)]
pub const fn set_fchid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Fault Protection Trigger on Channel 2"]
#[must_use]
#[inline(always)]
pub const fn fchid2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 2"]
#[inline(always)]
pub const fn set_fchid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Fault Protection Trigger on Channel 3"]
#[must_use]
#[inline(always)]
pub const fn fchid3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 3"]
#[inline(always)]
pub const fn set_fchid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Fault Protection Trigger on Channel 4"]
#[must_use]
#[inline(always)]
pub const fn fchid4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 4"]
#[inline(always)]
pub const fn set_fchid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Fault Protection Trigger on Channel 5"]
#[must_use]
#[inline(always)]
pub const fn fchid5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 5"]
#[inline(always)]
pub const fn set_fchid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Fault Protection Trigger on Channel 6"]
#[must_use]
#[inline(always)]
pub const fn fchid6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 6"]
#[inline(always)]
pub const fn set_fchid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Fault Protection Trigger on Channel 7"]
#[must_use]
#[inline(always)]
pub const fn fchid7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Fault Protection Trigger on Channel 7"]
#[inline(always)]
pub const fn set_fchid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Isr1 {
#[inline(always)]
fn default() -> Isr1 {
Isr1(0)
}
}
impl core::fmt::Debug for Isr1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Isr1")
.field("chid0", &self.chid0())
.field("chid1", &self.chid1())
.field("chid2", &self.chid2())
.field("chid3", &self.chid3())
.field("chid4", &self.chid4())
.field("chid5", &self.chid5())
.field("chid6", &self.chid6())
.field("chid7", &self.chid7())
.field("fchid0", &self.fchid0())
.field("fchid1", &self.fchid1())
.field("fchid2", &self.fchid2())
.field("fchid3", &self.fchid3())
.field("fchid4", &self.fchid4())
.field("fchid5", &self.fchid5())
.field("fchid6", &self.fchid6())
.field("fchid7", &self.fchid7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Isr1 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Isr1 {{ chid0: {=bool:?}, chid1: {=bool:?}, chid2: {=bool:?}, chid3: {=bool:?}, chid4: {=bool:?}, chid5: {=bool:?}, chid6: {=bool:?}, chid7: {=bool:?}, fchid0: {=bool:?}, fchid1: {=bool:?}, fchid2: {=bool:?}, fchid3: {=bool:?}, fchid4: {=bool:?}, fchid5: {=bool:?}, fchid6: {=bool:?}, fchid7: {=bool:?} }}",
self.chid0(),
self.chid1(),
self.chid2(),
self.chid3(),
self.chid4(),
self.chid5(),
self.chid6(),
self.chid7(),
self.fchid0(),
self.fchid1(),
self.fchid2(),
self.fchid3(),
self.fchid4(),
self.fchid5(),
self.fchid6(),
self.fchid7()
)
}
}
#[doc = "PWM Interrupt Status Register 2"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Isr2(pub u32);
impl Isr2 {
#[doc = "Write Ready for Synchronous Channels Update"]
#[must_use]
#[inline(always)]
pub const fn wrdy(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Write Ready for Synchronous Channels Update"]
#[inline(always)]
pub const fn set_wrdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "PDC End of TX Buffer"]
#[must_use]
#[inline(always)]
pub const fn endtx(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "PDC End of TX Buffer"]
#[inline(always)]
pub const fn set_endtx(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "PDC TX Buffer Empty"]
#[must_use]
#[inline(always)]
pub const fn txbufe(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "PDC TX Buffer Empty"]
#[inline(always)]
pub const fn set_txbufe(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Synchronous Channels Update Underrun Error"]
#[must_use]
#[inline(always)]
pub const fn unre(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Synchronous Channels Update Underrun Error"]
#[inline(always)]
pub const fn set_unre(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Comparison 0 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Match"]
#[inline(always)]
pub const fn set_cmpm0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Comparison 1 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Match"]
#[inline(always)]
pub const fn set_cmpm1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Comparison 2 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Match"]
#[inline(always)]
pub const fn set_cmpm2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Comparison 3 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Match"]
#[inline(always)]
pub const fn set_cmpm3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Comparison 4 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Match"]
#[inline(always)]
pub const fn set_cmpm4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Comparison 5 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Match"]
#[inline(always)]
pub const fn set_cmpm5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Comparison 6 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm6(&self) -> bool {
let val = (self.0 >> 14usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Match"]
#[inline(always)]
pub const fn set_cmpm6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
}
#[doc = "Comparison 7 Match"]
#[must_use]
#[inline(always)]
pub const fn cmpm7(&self) -> bool {
let val = (self.0 >> 15usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Match"]
#[inline(always)]
pub const fn set_cmpm7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
}
#[doc = "Comparison 0 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Comparison 0 Update"]
#[inline(always)]
pub const fn set_cmpu0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Comparison 1 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Comparison 1 Update"]
#[inline(always)]
pub const fn set_cmpu1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Comparison 2 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Comparison 2 Update"]
#[inline(always)]
pub const fn set_cmpu2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Comparison 3 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Comparison 3 Update"]
#[inline(always)]
pub const fn set_cmpu3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Comparison 4 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Comparison 4 Update"]
#[inline(always)]
pub const fn set_cmpu4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Comparison 5 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Comparison 5 Update"]
#[inline(always)]
pub const fn set_cmpu5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Comparison 6 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Comparison 6 Update"]
#[inline(always)]
pub const fn set_cmpu6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Comparison 7 Update"]
#[must_use]
#[inline(always)]
pub const fn cmpu7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Comparison 7 Update"]
#[inline(always)]
pub const fn set_cmpu7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Isr2 {
#[inline(always)]
fn default() -> Isr2 {
Isr2(0)
}
}
impl core::fmt::Debug for Isr2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Isr2")
.field("wrdy", &self.wrdy())
.field("endtx", &self.endtx())
.field("txbufe", &self.txbufe())
.field("unre", &self.unre())
.field("cmpm0", &self.cmpm0())
.field("cmpm1", &self.cmpm1())
.field("cmpm2", &self.cmpm2())
.field("cmpm3", &self.cmpm3())
.field("cmpm4", &self.cmpm4())
.field("cmpm5", &self.cmpm5())
.field("cmpm6", &self.cmpm6())
.field("cmpm7", &self.cmpm7())
.field("cmpu0", &self.cmpu0())
.field("cmpu1", &self.cmpu1())
.field("cmpu2", &self.cmpu2())
.field("cmpu3", &self.cmpu3())
.field("cmpu4", &self.cmpu4())
.field("cmpu5", &self.cmpu5())
.field("cmpu6", &self.cmpu6())
.field("cmpu7", &self.cmpu7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Isr2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Isr2 {{ wrdy: {=bool:?}, endtx: {=bool:?}, txbufe: {=bool:?}, unre: {=bool:?}, cmpm0: {=bool:?}, cmpm1: {=bool:?}, cmpm2: {=bool:?}, cmpm3: {=bool:?}, cmpm4: {=bool:?}, cmpm5: {=bool:?}, cmpm6: {=bool:?}, cmpm7: {=bool:?}, cmpu0: {=bool:?}, cmpu1: {=bool:?}, cmpu2: {=bool:?}, cmpu3: {=bool:?}, cmpu4: {=bool:?}, cmpu5: {=bool:?}, cmpu6: {=bool:?}, cmpu7: {=bool:?} }}",
self.wrdy(),
self.endtx(),
self.txbufe(),
self.unre(),
self.cmpm0(),
self.cmpm1(),
self.cmpm2(),
self.cmpm3(),
self.cmpm4(),
self.cmpm5(),
self.cmpm6(),
self.cmpm7(),
self.cmpu0(),
self.cmpu1(),
self.cmpu2(),
self.cmpu3(),
self.cmpu4(),
self.cmpu5(),
self.cmpu6(),
self.cmpu7()
)
}
}
#[doc = "PWM Output Override Value Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Oov(pub u32);
impl Oov {
#[doc = "Output Override Value for PWMH output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn oovh0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 0"]
#[inline(always)]
pub const fn set_oovh0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Output Override Value for PWMH output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn oovh1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 1"]
#[inline(always)]
pub const fn set_oovh1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Output Override Value for PWMH output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn oovh2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 2"]
#[inline(always)]
pub const fn set_oovh2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Output Override Value for PWMH output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn oovh3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 3"]
#[inline(always)]
pub const fn set_oovh3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Output Override Value for PWMH output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn oovh4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 4"]
#[inline(always)]
pub const fn set_oovh4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Output Override Value for PWMH output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn oovh5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 5"]
#[inline(always)]
pub const fn set_oovh5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Output Override Value for PWMH output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn oovh6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 6"]
#[inline(always)]
pub const fn set_oovh6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Output Override Value for PWMH output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn oovh7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWMH output of the channel 7"]
#[inline(always)]
pub const fn set_oovh7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Output Override Value for PWML output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn oovl0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 0"]
#[inline(always)]
pub const fn set_oovl0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Output Override Value for PWML output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn oovl1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 1"]
#[inline(always)]
pub const fn set_oovl1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Output Override Value for PWML output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn oovl2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 2"]
#[inline(always)]
pub const fn set_oovl2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Output Override Value for PWML output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn oovl3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 3"]
#[inline(always)]
pub const fn set_oovl3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Output Override Value for PWML output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn oovl4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 4"]
#[inline(always)]
pub const fn set_oovl4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Output Override Value for PWML output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn oovl5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 5"]
#[inline(always)]
pub const fn set_oovl5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Output Override Value for PWML output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn oovl6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 6"]
#[inline(always)]
pub const fn set_oovl6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Output Override Value for PWML output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn oovl7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Output Override Value for PWML output of the channel 7"]
#[inline(always)]
pub const fn set_oovl7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Oov {
#[inline(always)]
fn default() -> Oov {
Oov(0)
}
}
impl core::fmt::Debug for Oov {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Oov")
.field("oovh0", &self.oovh0())
.field("oovh1", &self.oovh1())
.field("oovh2", &self.oovh2())
.field("oovh3", &self.oovh3())
.field("oovh4", &self.oovh4())
.field("oovh5", &self.oovh5())
.field("oovh6", &self.oovh6())
.field("oovh7", &self.oovh7())
.field("oovl0", &self.oovl0())
.field("oovl1", &self.oovl1())
.field("oovl2", &self.oovl2())
.field("oovl3", &self.oovl3())
.field("oovl4", &self.oovl4())
.field("oovl5", &self.oovl5())
.field("oovl6", &self.oovl6())
.field("oovl7", &self.oovl7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Oov {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Oov {{ oovh0: {=bool:?}, oovh1: {=bool:?}, oovh2: {=bool:?}, oovh3: {=bool:?}, oovh4: {=bool:?}, oovh5: {=bool:?}, oovh6: {=bool:?}, oovh7: {=bool:?}, oovl0: {=bool:?}, oovl1: {=bool:?}, oovl2: {=bool:?}, oovl3: {=bool:?}, oovl4: {=bool:?}, oovl5: {=bool:?}, oovl6: {=bool:?}, oovl7: {=bool:?} }}",
self.oovh0(),
self.oovh1(),
self.oovh2(),
self.oovh3(),
self.oovh4(),
self.oovh5(),
self.oovh6(),
self.oovh7(),
self.oovl0(),
self.oovl1(),
self.oovl2(),
self.oovl3(),
self.oovl4(),
self.oovl5(),
self.oovl6(),
self.oovl7()
)
}
}
#[doc = "PWM Output Selection Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Os(pub u32);
impl Os {
#[doc = "Output Selection for PWMH output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn osh0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 0"]
#[inline(always)]
pub const fn set_osh0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Output Selection for PWMH output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn osh1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 1"]
#[inline(always)]
pub const fn set_osh1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Output Selection for PWMH output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn osh2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 2"]
#[inline(always)]
pub const fn set_osh2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Output Selection for PWMH output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn osh3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 3"]
#[inline(always)]
pub const fn set_osh3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Output Selection for PWMH output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn osh4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 4"]
#[inline(always)]
pub const fn set_osh4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Output Selection for PWMH output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn osh5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 5"]
#[inline(always)]
pub const fn set_osh5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Output Selection for PWMH output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn osh6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 6"]
#[inline(always)]
pub const fn set_osh6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Output Selection for PWMH output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn osh7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWMH output of the channel 7"]
#[inline(always)]
pub const fn set_osh7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Output Selection for PWML output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn osl0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 0"]
#[inline(always)]
pub const fn set_osl0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Output Selection for PWML output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn osl1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 1"]
#[inline(always)]
pub const fn set_osl1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Output Selection for PWML output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn osl2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 2"]
#[inline(always)]
pub const fn set_osl2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Output Selection for PWML output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn osl3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 3"]
#[inline(always)]
pub const fn set_osl3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Output Selection for PWML output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn osl4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 4"]
#[inline(always)]
pub const fn set_osl4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Output Selection for PWML output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn osl5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 5"]
#[inline(always)]
pub const fn set_osl5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Output Selection for PWML output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn osl6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 6"]
#[inline(always)]
pub const fn set_osl6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Output Selection for PWML output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn osl7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Output Selection for PWML output of the channel 7"]
#[inline(always)]
pub const fn set_osl7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Os {
#[inline(always)]
fn default() -> Os {
Os(0)
}
}
impl core::fmt::Debug for Os {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Os")
.field("osh0", &self.osh0())
.field("osh1", &self.osh1())
.field("osh2", &self.osh2())
.field("osh3", &self.osh3())
.field("osh4", &self.osh4())
.field("osh5", &self.osh5())
.field("osh6", &self.osh6())
.field("osh7", &self.osh7())
.field("osl0", &self.osl0())
.field("osl1", &self.osl1())
.field("osl2", &self.osl2())
.field("osl3", &self.osl3())
.field("osl4", &self.osl4())
.field("osl5", &self.osl5())
.field("osl6", &self.osl6())
.field("osl7", &self.osl7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Os {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Os {{ osh0: {=bool:?}, osh1: {=bool:?}, osh2: {=bool:?}, osh3: {=bool:?}, osh4: {=bool:?}, osh5: {=bool:?}, osh6: {=bool:?}, osh7: {=bool:?}, osl0: {=bool:?}, osl1: {=bool:?}, osl2: {=bool:?}, osl3: {=bool:?}, osl4: {=bool:?}, osl5: {=bool:?}, osl6: {=bool:?}, osl7: {=bool:?} }}",
self.osh0(),
self.osh1(),
self.osh2(),
self.osh3(),
self.osh4(),
self.osh5(),
self.osh6(),
self.osh7(),
self.osl0(),
self.osl1(),
self.osl2(),
self.osl3(),
self.osl4(),
self.osl5(),
self.osl6(),
self.osl7()
)
}
}
#[doc = "PWM Output Selection Clear Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Osc(pub u32);
impl Osc {
#[doc = "Output Selection Clear for PWMH output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn osch0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 0"]
#[inline(always)]
pub const fn set_osch0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn osch1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 1"]
#[inline(always)]
pub const fn set_osch1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn osch2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 2"]
#[inline(always)]
pub const fn set_osch2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn osch3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 3"]
#[inline(always)]
pub const fn set_osch3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn osch4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 4"]
#[inline(always)]
pub const fn set_osch4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn osch5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 5"]
#[inline(always)]
pub const fn set_osch5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn osch6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 6"]
#[inline(always)]
pub const fn set_osch6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn osch7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 7"]
#[inline(always)]
pub const fn set_osch7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn oscl0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 0"]
#[inline(always)]
pub const fn set_oscl0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn oscl1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 1"]
#[inline(always)]
pub const fn set_oscl1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn oscl2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 2"]
#[inline(always)]
pub const fn set_oscl2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn oscl3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 3"]
#[inline(always)]
pub const fn set_oscl3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn oscl4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 4"]
#[inline(always)]
pub const fn set_oscl4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn oscl5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 5"]
#[inline(always)]
pub const fn set_oscl5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn oscl6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 6"]
#[inline(always)]
pub const fn set_oscl6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn oscl7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 7"]
#[inline(always)]
pub const fn set_oscl7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Osc {
#[inline(always)]
fn default() -> Osc {
Osc(0)
}
}
impl core::fmt::Debug for Osc {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Osc")
.field("osch0", &self.osch0())
.field("osch1", &self.osch1())
.field("osch2", &self.osch2())
.field("osch3", &self.osch3())
.field("osch4", &self.osch4())
.field("osch5", &self.osch5())
.field("osch6", &self.osch6())
.field("osch7", &self.osch7())
.field("oscl0", &self.oscl0())
.field("oscl1", &self.oscl1())
.field("oscl2", &self.oscl2())
.field("oscl3", &self.oscl3())
.field("oscl4", &self.oscl4())
.field("oscl5", &self.oscl5())
.field("oscl6", &self.oscl6())
.field("oscl7", &self.oscl7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Osc {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Osc {{ osch0: {=bool:?}, osch1: {=bool:?}, osch2: {=bool:?}, osch3: {=bool:?}, osch4: {=bool:?}, osch5: {=bool:?}, osch6: {=bool:?}, osch7: {=bool:?}, oscl0: {=bool:?}, oscl1: {=bool:?}, oscl2: {=bool:?}, oscl3: {=bool:?}, oscl4: {=bool:?}, oscl5: {=bool:?}, oscl6: {=bool:?}, oscl7: {=bool:?} }}",
self.osch0(),
self.osch1(),
self.osch2(),
self.osch3(),
self.osch4(),
self.osch5(),
self.osch6(),
self.osch7(),
self.oscl0(),
self.oscl1(),
self.oscl2(),
self.oscl3(),
self.oscl4(),
self.oscl5(),
self.oscl6(),
self.oscl7()
)
}
}
#[doc = "PWM Output Selection Clear Update Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Oscupd(pub u32);
impl Oscupd {
#[doc = "Output Selection Clear for PWMH output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn oscuph0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 0"]
#[inline(always)]
pub const fn set_oscuph0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn oscuph1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 1"]
#[inline(always)]
pub const fn set_oscuph1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn oscuph2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 2"]
#[inline(always)]
pub const fn set_oscuph2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn oscuph3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 3"]
#[inline(always)]
pub const fn set_oscuph3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn oscuph4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 4"]
#[inline(always)]
pub const fn set_oscuph4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn oscuph5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 5"]
#[inline(always)]
pub const fn set_oscuph5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn oscuph6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 6"]
#[inline(always)]
pub const fn set_oscuph6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Output Selection Clear for PWMH output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn oscuph7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWMH output of the channel 7"]
#[inline(always)]
pub const fn set_oscuph7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn oscupl0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 0"]
#[inline(always)]
pub const fn set_oscupl0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn oscupl1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 1"]
#[inline(always)]
pub const fn set_oscupl1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn oscupl2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 2"]
#[inline(always)]
pub const fn set_oscupl2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn oscupl3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 3"]
#[inline(always)]
pub const fn set_oscupl3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn oscupl4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 4"]
#[inline(always)]
pub const fn set_oscupl4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn oscupl5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 5"]
#[inline(always)]
pub const fn set_oscupl5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn oscupl6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 6"]
#[inline(always)]
pub const fn set_oscupl6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Output Selection Clear for PWML output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn oscupl7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Output Selection Clear for PWML output of the channel 7"]
#[inline(always)]
pub const fn set_oscupl7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Oscupd {
#[inline(always)]
fn default() -> Oscupd {
Oscupd(0)
}
}
impl core::fmt::Debug for Oscupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Oscupd")
.field("oscuph0", &self.oscuph0())
.field("oscuph1", &self.oscuph1())
.field("oscuph2", &self.oscuph2())
.field("oscuph3", &self.oscuph3())
.field("oscuph4", &self.oscuph4())
.field("oscuph5", &self.oscuph5())
.field("oscuph6", &self.oscuph6())
.field("oscuph7", &self.oscuph7())
.field("oscupl0", &self.oscupl0())
.field("oscupl1", &self.oscupl1())
.field("oscupl2", &self.oscupl2())
.field("oscupl3", &self.oscupl3())
.field("oscupl4", &self.oscupl4())
.field("oscupl5", &self.oscupl5())
.field("oscupl6", &self.oscupl6())
.field("oscupl7", &self.oscupl7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Oscupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Oscupd {{ oscuph0: {=bool:?}, oscuph1: {=bool:?}, oscuph2: {=bool:?}, oscuph3: {=bool:?}, oscuph4: {=bool:?}, oscuph5: {=bool:?}, oscuph6: {=bool:?}, oscuph7: {=bool:?}, oscupl0: {=bool:?}, oscupl1: {=bool:?}, oscupl2: {=bool:?}, oscupl3: {=bool:?}, oscupl4: {=bool:?}, oscupl5: {=bool:?}, oscupl6: {=bool:?}, oscupl7: {=bool:?} }}",
self.oscuph0(),
self.oscuph1(),
self.oscuph2(),
self.oscuph3(),
self.oscuph4(),
self.oscuph5(),
self.oscuph6(),
self.oscuph7(),
self.oscupl0(),
self.oscupl1(),
self.oscupl2(),
self.oscupl3(),
self.oscupl4(),
self.oscupl5(),
self.oscupl6(),
self.oscupl7()
)
}
}
#[doc = "PWM Output Selection Set Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Oss(pub u32);
impl Oss {
#[doc = "Output Selection Set for PWMH output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn ossh0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 0"]
#[inline(always)]
pub const fn set_ossh0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn ossh1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 1"]
#[inline(always)]
pub const fn set_ossh1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn ossh2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 2"]
#[inline(always)]
pub const fn set_ossh2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn ossh3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 3"]
#[inline(always)]
pub const fn set_ossh3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn ossh4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 4"]
#[inline(always)]
pub const fn set_ossh4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn ossh5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 5"]
#[inline(always)]
pub const fn set_ossh5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn ossh6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 6"]
#[inline(always)]
pub const fn set_ossh6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn ossh7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 7"]
#[inline(always)]
pub const fn set_ossh7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Output Selection Set for PWML output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn ossl0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 0"]
#[inline(always)]
pub const fn set_ossl0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Output Selection Set for PWML output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn ossl1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 1"]
#[inline(always)]
pub const fn set_ossl1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Output Selection Set for PWML output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn ossl2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 2"]
#[inline(always)]
pub const fn set_ossl2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Output Selection Set for PWML output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn ossl3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 3"]
#[inline(always)]
pub const fn set_ossl3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Output Selection Set for PWML output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn ossl4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 4"]
#[inline(always)]
pub const fn set_ossl4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Output Selection Set for PWML output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn ossl5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 5"]
#[inline(always)]
pub const fn set_ossl5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Output Selection Set for PWML output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn ossl6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 6"]
#[inline(always)]
pub const fn set_ossl6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Output Selection Set for PWML output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn ossl7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 7"]
#[inline(always)]
pub const fn set_ossl7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Oss {
#[inline(always)]
fn default() -> Oss {
Oss(0)
}
}
impl core::fmt::Debug for Oss {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Oss")
.field("ossh0", &self.ossh0())
.field("ossh1", &self.ossh1())
.field("ossh2", &self.ossh2())
.field("ossh3", &self.ossh3())
.field("ossh4", &self.ossh4())
.field("ossh5", &self.ossh5())
.field("ossh6", &self.ossh6())
.field("ossh7", &self.ossh7())
.field("ossl0", &self.ossl0())
.field("ossl1", &self.ossl1())
.field("ossl2", &self.ossl2())
.field("ossl3", &self.ossl3())
.field("ossl4", &self.ossl4())
.field("ossl5", &self.ossl5())
.field("ossl6", &self.ossl6())
.field("ossl7", &self.ossl7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Oss {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Oss {{ ossh0: {=bool:?}, ossh1: {=bool:?}, ossh2: {=bool:?}, ossh3: {=bool:?}, ossh4: {=bool:?}, ossh5: {=bool:?}, ossh6: {=bool:?}, ossh7: {=bool:?}, ossl0: {=bool:?}, ossl1: {=bool:?}, ossl2: {=bool:?}, ossl3: {=bool:?}, ossl4: {=bool:?}, ossl5: {=bool:?}, ossl6: {=bool:?}, ossl7: {=bool:?} }}",
self.ossh0(),
self.ossh1(),
self.ossh2(),
self.ossh3(),
self.ossh4(),
self.ossh5(),
self.ossh6(),
self.ossh7(),
self.ossl0(),
self.ossl1(),
self.ossl2(),
self.ossl3(),
self.ossl4(),
self.ossl5(),
self.ossl6(),
self.ossl7()
)
}
}
#[doc = "PWM Output Selection Set Update Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ossupd(pub u32);
impl Ossupd {
#[doc = "Output Selection Set for PWMH output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn ossuph0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 0"]
#[inline(always)]
pub const fn set_ossuph0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn ossuph1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 1"]
#[inline(always)]
pub const fn set_ossuph1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn ossuph2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 2"]
#[inline(always)]
pub const fn set_ossuph2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn ossuph3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 3"]
#[inline(always)]
pub const fn set_ossuph3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn ossuph4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 4"]
#[inline(always)]
pub const fn set_ossuph4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn ossuph5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 5"]
#[inline(always)]
pub const fn set_ossuph5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn ossuph6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 6"]
#[inline(always)]
pub const fn set_ossuph6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Output Selection Set for PWMH output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn ossuph7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWMH output of the channel 7"]
#[inline(always)]
pub const fn set_ossuph7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Output Selection Set for PWML output of the channel 0"]
#[must_use]
#[inline(always)]
pub const fn ossupl0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 0"]
#[inline(always)]
pub const fn set_ossupl0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Output Selection Set for PWML output of the channel 1"]
#[must_use]
#[inline(always)]
pub const fn ossupl1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 1"]
#[inline(always)]
pub const fn set_ossupl1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Output Selection Set for PWML output of the channel 2"]
#[must_use]
#[inline(always)]
pub const fn ossupl2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 2"]
#[inline(always)]
pub const fn set_ossupl2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Output Selection Set for PWML output of the channel 3"]
#[must_use]
#[inline(always)]
pub const fn ossupl3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 3"]
#[inline(always)]
pub const fn set_ossupl3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Output Selection Set for PWML output of the channel 4"]
#[must_use]
#[inline(always)]
pub const fn ossupl4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 4"]
#[inline(always)]
pub const fn set_ossupl4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Output Selection Set for PWML output of the channel 5"]
#[must_use]
#[inline(always)]
pub const fn ossupl5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 5"]
#[inline(always)]
pub const fn set_ossupl5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Output Selection Set for PWML output of the channel 6"]
#[must_use]
#[inline(always)]
pub const fn ossupl6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 6"]
#[inline(always)]
pub const fn set_ossupl6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Output Selection Set for PWML output of the channel 7"]
#[must_use]
#[inline(always)]
pub const fn ossupl7(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Output Selection Set for PWML output of the channel 7"]
#[inline(always)]
pub const fn set_ossupl7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
}
impl Default for Ossupd {
#[inline(always)]
fn default() -> Ossupd {
Ossupd(0)
}
}
impl core::fmt::Debug for Ossupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ossupd")
.field("ossuph0", &self.ossuph0())
.field("ossuph1", &self.ossuph1())
.field("ossuph2", &self.ossuph2())
.field("ossuph3", &self.ossuph3())
.field("ossuph4", &self.ossuph4())
.field("ossuph5", &self.ossuph5())
.field("ossuph6", &self.ossuph6())
.field("ossuph7", &self.ossuph7())
.field("ossupl0", &self.ossupl0())
.field("ossupl1", &self.ossupl1())
.field("ossupl2", &self.ossupl2())
.field("ossupl3", &self.ossupl3())
.field("ossupl4", &self.ossupl4())
.field("ossupl5", &self.ossupl5())
.field("ossupl6", &self.ossupl6())
.field("ossupl7", &self.ossupl7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ossupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ossupd {{ ossuph0: {=bool:?}, ossuph1: {=bool:?}, ossuph2: {=bool:?}, ossuph3: {=bool:?}, ossuph4: {=bool:?}, ossuph5: {=bool:?}, ossuph6: {=bool:?}, ossuph7: {=bool:?}, ossupl0: {=bool:?}, ossupl1: {=bool:?}, ossupl2: {=bool:?}, ossupl3: {=bool:?}, ossupl4: {=bool:?}, ossupl5: {=bool:?}, ossupl6: {=bool:?}, ossupl7: {=bool:?} }}",
self.ossuph0(),
self.ossuph1(),
self.ossuph2(),
self.ossuph3(),
self.ossuph4(),
self.ossuph5(),
self.ossuph6(),
self.ossuph7(),
self.ossupl0(),
self.ossupl1(),
self.ossupl2(),
self.ossupl3(),
self.ossupl4(),
self.ossupl5(),
self.ossupl6(),
self.ossupl7()
)
}
}
#[doc = "Transfer Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ptcr(pub u32);
impl Ptcr {
#[doc = "Receiver Transfer Enable"]
#[must_use]
#[inline(always)]
pub const fn rxten(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Receiver Transfer Enable"]
#[inline(always)]
pub const fn set_rxten(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Receiver Transfer Disable"]
#[must_use]
#[inline(always)]
pub const fn rxtdis(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Receiver Transfer Disable"]
#[inline(always)]
pub const fn set_rxtdis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Transmitter Transfer Enable"]
#[must_use]
#[inline(always)]
pub const fn txten(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Transmitter Transfer Enable"]
#[inline(always)]
pub const fn set_txten(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Transmitter Transfer Disable"]
#[must_use]
#[inline(always)]
pub const fn txtdis(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Transmitter Transfer Disable"]
#[inline(always)]
pub const fn set_txtdis(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
}
impl Default for Ptcr {
#[inline(always)]
fn default() -> Ptcr {
Ptcr(0)
}
}
impl core::fmt::Debug for Ptcr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ptcr")
.field("rxten", &self.rxten())
.field("rxtdis", &self.rxtdis())
.field("txten", &self.txten())
.field("txtdis", &self.txtdis())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ptcr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ptcr {{ rxten: {=bool:?}, rxtdis: {=bool:?}, txten: {=bool:?}, txtdis: {=bool:?} }}",
self.rxten(),
self.rxtdis(),
self.txten(),
self.txtdis()
)
}
}
#[doc = "Transfer Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ptsr(pub u32);
impl Ptsr {
#[doc = "Receiver Transfer Enable"]
#[must_use]
#[inline(always)]
pub const fn rxten(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Receiver Transfer Enable"]
#[inline(always)]
pub const fn set_rxten(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Transmitter Transfer Enable"]
#[must_use]
#[inline(always)]
pub const fn txten(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Transmitter Transfer Enable"]
#[inline(always)]
pub const fn set_txten(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
}
impl Default for Ptsr {
#[inline(always)]
fn default() -> Ptsr {
Ptsr(0)
}
}
impl core::fmt::Debug for Ptsr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ptsr")
.field("rxten", &self.rxten())
.field("txten", &self.txten())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ptsr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Ptsr {{ rxten: {=bool:?}, txten: {=bool:?} }}",
self.rxten(),
self.txten()
)
}
}
#[doc = "PWM Sync Channels Mode Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Scm(pub u32);
impl Scm {
#[doc = "Synchronous Channel 0"]
#[must_use]
#[inline(always)]
pub const fn sync(&self, n: usize) -> bool {
assert!(n < 8usize);
let offs = 0usize + n * 1usize;
let val = (self.0 >> offs) & 0x01;
val != 0
}
#[doc = "Synchronous Channel 0"]
#[inline(always)]
pub const fn set_sync(&mut self, n: usize, val: bool) {
assert!(n < 8usize);
let offs = 0usize + n * 1usize;
self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
}
#[doc = "Synchronous Channels Update Mode"]
#[must_use]
#[inline(always)]
pub const fn updm(&self) -> super::vals::Updm {
let val = (self.0 >> 16usize) & 0x03;
super::vals::Updm::from_bits(val as u8)
}
#[doc = "Synchronous Channels Update Mode"]
#[inline(always)]
pub const fn set_updm(&mut self, val: super::vals::Updm) {
self.0 = (self.0 & !(0x03 << 16usize)) | (((val.to_bits() as u32) & 0x03) << 16usize);
}
#[doc = "PDC Transfer Request Mode"]
#[must_use]
#[inline(always)]
pub const fn ptrm(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "PDC Transfer Request Mode"]
#[inline(always)]
pub const fn set_ptrm(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "PDC Transfer Request Comparison Selection"]
#[must_use]
#[inline(always)]
pub const fn ptrcs(&self) -> u8 {
let val = (self.0 >> 21usize) & 0x07;
val as u8
}
#[doc = "PDC Transfer Request Comparison Selection"]
#[inline(always)]
pub const fn set_ptrcs(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 21usize)) | (((val as u32) & 0x07) << 21usize);
}
}
impl Default for Scm {
#[inline(always)]
fn default() -> Scm {
Scm(0)
}
}
impl core::fmt::Debug for Scm {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Scm")
.field("sync[0]", &self.sync(0usize))
.field("sync[1]", &self.sync(1usize))
.field("sync[2]", &self.sync(2usize))
.field("sync[3]", &self.sync(3usize))
.field("sync[4]", &self.sync(4usize))
.field("sync[5]", &self.sync(5usize))
.field("sync[6]", &self.sync(6usize))
.field("sync[7]", &self.sync(7usize))
.field("updm", &self.updm())
.field("ptrm", &self.ptrm())
.field("ptrcs", &self.ptrcs())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Scm {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Scm {{ sync[0]: {=bool:?}, sync[1]: {=bool:?}, sync[2]: {=bool:?}, sync[3]: {=bool:?}, sync[4]: {=bool:?}, sync[5]: {=bool:?}, sync[6]: {=bool:?}, sync[7]: {=bool:?}, updm: {:?}, ptrm: {=bool:?}, ptrcs: {=u8:?} }}",
self.sync(0usize),
self.sync(1usize),
self.sync(2usize),
self.sync(3usize),
self.sync(4usize),
self.sync(5usize),
self.sync(6usize),
self.sync(7usize),
self.updm(),
self.ptrm(),
self.ptrcs()
)
}
}
#[doc = "PWM Sync Channels Update Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Scuc(pub u32);
impl Scuc {
#[doc = "Synchronous Channels Update Unlock"]
#[must_use]
#[inline(always)]
pub const fn updulock(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Synchronous Channels Update Unlock"]
#[inline(always)]
pub const fn set_updulock(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
}
impl Default for Scuc {
#[inline(always)]
fn default() -> Scuc {
Scuc(0)
}
}
impl core::fmt::Debug for Scuc {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Scuc")
.field("updulock", &self.updulock())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Scuc {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Scuc {{ updulock: {=bool:?} }}", self.updulock())
}
}
#[doc = "PWM Sync Channels Update Period Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Scup(pub u32);
impl Scup {
#[doc = "Update Period"]
#[must_use]
#[inline(always)]
pub const fn upr(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "Update Period"]
#[inline(always)]
pub const fn set_upr(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
#[doc = "Update Period Counter"]
#[must_use]
#[inline(always)]
pub const fn uprcnt(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x0f;
val as u8
}
#[doc = "Update Period Counter"]
#[inline(always)]
pub const fn set_uprcnt(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
}
}
impl Default for Scup {
#[inline(always)]
fn default() -> Scup {
Scup(0)
}
}
impl core::fmt::Debug for Scup {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Scup")
.field("upr", &self.upr())
.field("uprcnt", &self.uprcnt())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Scup {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Scup {{ upr: {=u8:?}, uprcnt: {=u8:?} }}",
self.upr(),
self.uprcnt()
)
}
}
#[doc = "PWM Sync Channels Update Period Update Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Scupupd(pub u32);
impl Scupupd {
#[doc = "Update Period Update"]
#[must_use]
#[inline(always)]
pub const fn uprupd(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x0f;
val as u8
}
#[doc = "Update Period Update"]
#[inline(always)]
pub const fn set_uprupd(&mut self, val: u8) {
self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
}
}
impl Default for Scupupd {
#[inline(always)]
fn default() -> Scupupd {
Scupupd(0)
}
}
impl core::fmt::Debug for Scupupd {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Scupupd")
.field("uprupd", &self.uprupd())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Scupupd {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Scupupd {{ uprupd: {=u8:?} }}", self.uprupd())
}
}
#[doc = "PWM Stepper Motor Mode Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Smmr(pub u32);
impl Smmr {
#[doc = "Gray Count ENable"]
#[must_use]
#[inline(always)]
pub const fn gcen0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Gray Count ENable"]
#[inline(always)]
pub const fn set_gcen0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Gray Count ENable"]
#[must_use]
#[inline(always)]
pub const fn gcen1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Gray Count ENable"]
#[inline(always)]
pub const fn set_gcen1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Gray Count ENable"]
#[must_use]
#[inline(always)]
pub const fn gcen2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Gray Count ENable"]
#[inline(always)]
pub const fn set_gcen2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Gray Count ENable"]
#[must_use]
#[inline(always)]
pub const fn gcen3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Gray Count ENable"]
#[inline(always)]
pub const fn set_gcen3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "DOWN Count"]
#[must_use]
#[inline(always)]
pub const fn down0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "DOWN Count"]
#[inline(always)]
pub const fn set_down0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "DOWN Count"]
#[must_use]
#[inline(always)]
pub const fn down1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "DOWN Count"]
#[inline(always)]
pub const fn set_down1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "DOWN Count"]
#[must_use]
#[inline(always)]
pub const fn down2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "DOWN Count"]
#[inline(always)]
pub const fn set_down2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "DOWN Count"]
#[must_use]
#[inline(always)]
pub const fn down3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "DOWN Count"]
#[inline(always)]
pub const fn set_down3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
}
impl Default for Smmr {
#[inline(always)]
fn default() -> Smmr {
Smmr(0)
}
}
impl core::fmt::Debug for Smmr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Smmr")
.field("gcen0", &self.gcen0())
.field("gcen1", &self.gcen1())
.field("gcen2", &self.gcen2())
.field("gcen3", &self.gcen3())
.field("down0", &self.down0())
.field("down1", &self.down1())
.field("down2", &self.down2())
.field("down3", &self.down3())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Smmr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Smmr {{ gcen0: {=bool:?}, gcen1: {=bool:?}, gcen2: {=bool:?}, gcen3: {=bool:?}, down0: {=bool:?}, down1: {=bool:?}, down2: {=bool:?}, down3: {=bool:?} }}",
self.gcen0(),
self.gcen1(),
self.gcen2(),
self.gcen3(),
self.down0(),
self.down1(),
self.down2(),
self.down3()
)
}
}
#[doc = "PWM Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Sr(pub u32);
impl Sr {
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Channel ID"]
#[must_use]
#[inline(always)]
pub const fn chid7(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Channel ID"]
#[inline(always)]
pub const fn set_chid7(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
}
impl Default for Sr {
#[inline(always)]
fn default() -> Sr {
Sr(0)
}
}
impl core::fmt::Debug for Sr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Sr")
.field("chid0", &self.chid0())
.field("chid1", &self.chid1())
.field("chid2", &self.chid2())
.field("chid3", &self.chid3())
.field("chid4", &self.chid4())
.field("chid5", &self.chid5())
.field("chid6", &self.chid6())
.field("chid7", &self.chid7())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Sr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Sr {{ chid0: {=bool:?}, chid1: {=bool:?}, chid2: {=bool:?}, chid3: {=bool:?}, chid4: {=bool:?}, chid5: {=bool:?}, chid6: {=bool:?}, chid7: {=bool:?} }}",
self.chid0(),
self.chid1(),
self.chid2(),
self.chid3(),
self.chid4(),
self.chid5(),
self.chid6(),
self.chid7()
)
}
}
#[doc = "Transmit Counter Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Tcr(pub u32);
impl Tcr {
#[doc = "Transmit Counter Register"]
#[must_use]
#[inline(always)]
pub const fn txctr(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Transmit Counter Register"]
#[inline(always)]
pub const fn set_txctr(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
}
impl Default for Tcr {
#[inline(always)]
fn default() -> Tcr {
Tcr(0)
}
}
impl core::fmt::Debug for Tcr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Tcr").field("txctr", &self.txctr()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Tcr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Tcr {{ txctr: {=u16:?} }}", self.txctr())
}
}
#[doc = "Transmit Next Counter Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Tncr(pub u32);
impl Tncr {
#[doc = "Transmit Counter Next"]
#[must_use]
#[inline(always)]
pub const fn txnctr(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Transmit Counter Next"]
#[inline(always)]
pub const fn set_txnctr(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
}
impl Default for Tncr {
#[inline(always)]
fn default() -> Tncr {
Tncr(0)
}
}
impl core::fmt::Debug for Tncr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Tncr")
.field("txnctr", &self.txnctr())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Tncr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Tncr {{ txnctr: {=u16:?} }}", self.txnctr())
}
}
#[doc = "Transmit Next Pointer Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Tnpr(pub u32);
impl Tnpr {
#[doc = "Transmit Next Pointer"]
#[must_use]
#[inline(always)]
pub const fn txnptr(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Transmit Next Pointer"]
#[inline(always)]
pub const fn set_txnptr(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Tnpr {
#[inline(always)]
fn default() -> Tnpr {
Tnpr(0)
}
}
impl core::fmt::Debug for Tnpr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Tnpr")
.field("txnptr", &self.txnptr())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Tnpr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Tnpr {{ txnptr: {=u32:?} }}", self.txnptr())
}
}
#[doc = "Transmit Pointer Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Tpr(pub u32);
impl Tpr {
#[doc = "Transmit Counter Register"]
#[must_use]
#[inline(always)]
pub const fn txptr(&self) -> u32 {
let val = (self.0 >> 0usize) & 0xffff_ffff;
val as u32
}
#[doc = "Transmit Counter Register"]
#[inline(always)]
pub const fn set_txptr(&mut self, val: u32) {
self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
}
}
impl Default for Tpr {
#[inline(always)]
fn default() -> Tpr {
Tpr(0)
}
}
impl core::fmt::Debug for Tpr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Tpr").field("txptr", &self.txptr()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Tpr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Tpr {{ txptr: {=u32:?} }}", self.txptr())
}
}
#[doc = "PWM Write Protect Control Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Wpcr(pub u32);
impl Wpcr {
#[doc = "Write Protect Command"]
#[must_use]
#[inline(always)]
pub const fn wpcmd(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Write Protect Command"]
#[inline(always)]
pub const fn set_wpcmd(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Write Protect Register Group 0"]
#[must_use]
#[inline(always)]
pub const fn wprg(&self, n: usize) -> bool {
assert!(n < 6usize);
let offs = 2usize + n * 1usize;
let val = (self.0 >> offs) & 0x01;
val != 0
}
#[doc = "Write Protect Register Group 0"]
#[inline(always)]
pub const fn set_wprg(&mut self, n: usize, val: bool) {
assert!(n < 6usize);
let offs = 2usize + n * 1usize;
self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
}
#[doc = "Write Protect Key"]
#[must_use]
#[inline(always)]
pub const fn wpkey(&self) -> u32 {
let val = (self.0 >> 8usize) & 0x00ff_ffff;
val as u32
}
#[doc = "Write Protect Key"]
#[inline(always)]
pub const fn set_wpkey(&mut self, val: u32) {
self.0 = (self.0 & !(0x00ff_ffff << 8usize)) | (((val as u32) & 0x00ff_ffff) << 8usize);
}
}
impl Default for Wpcr {
#[inline(always)]
fn default() -> Wpcr {
Wpcr(0)
}
}
impl core::fmt::Debug for Wpcr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Wpcr")
.field("wpcmd", &self.wpcmd())
.field("wprg[0]", &self.wprg(0usize))
.field("wprg[1]", &self.wprg(1usize))
.field("wprg[2]", &self.wprg(2usize))
.field("wprg[3]", &self.wprg(3usize))
.field("wprg[4]", &self.wprg(4usize))
.field("wprg[5]", &self.wprg(5usize))
.field("wpkey", &self.wpkey())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Wpcr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Wpcr {{ wpcmd: {=u8:?}, wprg[0]: {=bool:?}, wprg[1]: {=bool:?}, wprg[2]: {=bool:?}, wprg[3]: {=bool:?}, wprg[4]: {=bool:?}, wprg[5]: {=bool:?}, wpkey: {=u32:?} }}",
self.wpcmd(),
self.wprg(0usize),
self.wprg(1usize),
self.wprg(2usize),
self.wprg(3usize),
self.wprg(4usize),
self.wprg(5usize),
self.wpkey()
)
}
}
#[doc = "PWM Write Protect Status Register"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Wpsr(pub u32);
impl Wpsr {
#[doc = "Write Protect SW Status"]
#[must_use]
#[inline(always)]
pub const fn wpsws0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Write Protect SW Status"]
#[inline(always)]
pub const fn set_wpsws0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Write Protect SW Status"]
#[must_use]
#[inline(always)]
pub const fn wpsws1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Write Protect SW Status"]
#[inline(always)]
pub const fn set_wpsws1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Write Protect SW Status"]
#[must_use]
#[inline(always)]
pub const fn wpsws2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Write Protect SW Status"]
#[inline(always)]
pub const fn set_wpsws2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Write Protect SW Status"]
#[must_use]
#[inline(always)]
pub const fn wpsws3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Write Protect SW Status"]
#[inline(always)]
pub const fn set_wpsws3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Write Protect SW Status"]
#[must_use]
#[inline(always)]
pub const fn wpsws4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Write Protect SW Status"]
#[inline(always)]
pub const fn set_wpsws4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Write Protect SW Status"]
#[must_use]
#[inline(always)]
pub const fn wpsws5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Write Protect SW Status"]
#[inline(always)]
pub const fn set_wpsws5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Write Protect Violation Status"]
#[must_use]
#[inline(always)]
pub const fn wpvs(&self) -> bool {
let val = (self.0 >> 7usize) & 0x01;
val != 0
}
#[doc = "Write Protect Violation Status"]
#[inline(always)]
pub const fn set_wpvs(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
}
#[doc = "Write Protect HW Status"]
#[must_use]
#[inline(always)]
pub const fn wphws0(&self) -> bool {
let val = (self.0 >> 8usize) & 0x01;
val != 0
}
#[doc = "Write Protect HW Status"]
#[inline(always)]
pub const fn set_wphws0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
}
#[doc = "Write Protect HW Status"]
#[must_use]
#[inline(always)]
pub const fn wphws1(&self) -> bool {
let val = (self.0 >> 9usize) & 0x01;
val != 0
}
#[doc = "Write Protect HW Status"]
#[inline(always)]
pub const fn set_wphws1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
}
#[doc = "Write Protect HW Status"]
#[must_use]
#[inline(always)]
pub const fn wphws2(&self) -> bool {
let val = (self.0 >> 10usize) & 0x01;
val != 0
}
#[doc = "Write Protect HW Status"]
#[inline(always)]
pub const fn set_wphws2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
}
#[doc = "Write Protect HW Status"]
#[must_use]
#[inline(always)]
pub const fn wphws3(&self) -> bool {
let val = (self.0 >> 11usize) & 0x01;
val != 0
}
#[doc = "Write Protect HW Status"]
#[inline(always)]
pub const fn set_wphws3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
}
#[doc = "Write Protect HW Status"]
#[must_use]
#[inline(always)]
pub const fn wphws4(&self) -> bool {
let val = (self.0 >> 12usize) & 0x01;
val != 0
}
#[doc = "Write Protect HW Status"]
#[inline(always)]
pub const fn set_wphws4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
}
#[doc = "Write Protect HW Status"]
#[must_use]
#[inline(always)]
pub const fn wphws5(&self) -> bool {
let val = (self.0 >> 13usize) & 0x01;
val != 0
}
#[doc = "Write Protect HW Status"]
#[inline(always)]
pub const fn set_wphws5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
}
#[doc = "Write Protect Violation Source"]
#[must_use]
#[inline(always)]
pub const fn wpvsrc(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Write Protect Violation Source"]
#[inline(always)]
pub const fn set_wpvsrc(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Wpsr {
#[inline(always)]
fn default() -> Wpsr {
Wpsr(0)
}
}
impl core::fmt::Debug for Wpsr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Wpsr")
.field("wpsws0", &self.wpsws0())
.field("wpsws1", &self.wpsws1())
.field("wpsws2", &self.wpsws2())
.field("wpsws3", &self.wpsws3())
.field("wpsws4", &self.wpsws4())
.field("wpsws5", &self.wpsws5())
.field("wpvs", &self.wpvs())
.field("wphws0", &self.wphws0())
.field("wphws1", &self.wphws1())
.field("wphws2", &self.wphws2())
.field("wphws3", &self.wphws3())
.field("wphws4", &self.wphws4())
.field("wphws5", &self.wphws5())
.field("wpvsrc", &self.wpvsrc())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Wpsr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Wpsr {{ wpsws0: {=bool:?}, wpsws1: {=bool:?}, wpsws2: {=bool:?}, wpsws3: {=bool:?}, wpsws4: {=bool:?}, wpsws5: {=bool:?}, wpvs: {=bool:?}, wphws0: {=bool:?}, wphws1: {=bool:?}, wphws2: {=bool:?}, wphws3: {=bool:?}, wphws4: {=bool:?}, wphws5: {=bool:?}, wpvsrc: {=u16:?} }}",
self.wpsws0(),
self.wpsws1(),
self.wpsws2(),
self.wpsws3(),
self.wpsws4(),
self.wpsws5(),
self.wpvs(),
self.wphws0(),
self.wphws1(),
self.wphws2(),
self.wphws3(),
self.wphws4(),
self.wphws5(),
self.wpvsrc()
)
}
}