#[doc = "ARR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Arr(pub u32);
impl Arr {
#[doc = "Auto reload value"]
#[must_use]
#[inline(always)]
pub const fn arr(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Auto reload value"]
#[inline(always)]
pub const fn set_arr(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
}
impl Default for Arr {
#[inline(always)]
fn default() -> Arr {
Arr(0)
}
}
impl core::fmt::Debug for Arr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Arr").field("arr", &self.arr()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Arr {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Arr {{ arr: {=u16:?} }}", self.arr())
}
}
#[doc = "CFGR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfgr(pub u32);
impl Cfgr {
#[doc = "Clock source selection"]
#[must_use]
#[inline(always)]
pub const fn cksel(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Clock source selection"]
#[inline(always)]
pub const fn set_cksel(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Clock polarity"]
#[must_use]
#[inline(always)]
pub const fn ckpol(&self) -> u8 {
let val = (self.0 >> 1usize) & 0x03;
val as u8
}
#[doc = "Clock polarity"]
#[inline(always)]
pub const fn set_ckpol(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 1usize)) | (((val as u32) & 0x03) << 1usize);
}
#[doc = "Digital filter for external clock"]
#[must_use]
#[inline(always)]
pub const fn ckflt(&self) -> u8 {
let val = (self.0 >> 3usize) & 0x03;
val as u8
}
#[doc = "Digital filter for external clock"]
#[inline(always)]
pub const fn set_ckflt(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 3usize)) | (((val as u32) & 0x03) << 3usize);
}
#[doc = "Digital filter for trigger"]
#[must_use]
#[inline(always)]
pub const fn trgflt(&self) -> u8 {
let val = (self.0 >> 6usize) & 0x03;
val as u8
}
#[doc = "Digital filter for trigger"]
#[inline(always)]
pub const fn set_trgflt(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 6usize)) | (((val as u32) & 0x03) << 6usize);
}
#[doc = "Clock prescaler"]
#[must_use]
#[inline(always)]
pub const fn presc(&self) -> u8 {
let val = (self.0 >> 9usize) & 0x07;
val as u8
}
#[doc = "Clock prescaler"]
#[inline(always)]
pub const fn set_presc(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 9usize)) | (((val as u32) & 0x07) << 9usize);
}
#[doc = "Trigger seletion"]
#[must_use]
#[inline(always)]
pub const fn trigsel(&self) -> u8 {
let val = (self.0 >> 13usize) & 0x07;
val as u8
}
#[doc = "Trigger seletion"]
#[inline(always)]
pub const fn set_trigsel(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 13usize)) | (((val as u32) & 0x07) << 13usize);
}
#[doc = "Trigger enable"]
#[must_use]
#[inline(always)]
pub const fn trigen(&self) -> u8 {
let val = (self.0 >> 17usize) & 0x03;
val as u8
}
#[doc = "Trigger enable"]
#[inline(always)]
pub const fn set_trigen(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 17usize)) | (((val as u32) & 0x03) << 17usize);
}
#[doc = "Enable timeout"]
#[must_use]
#[inline(always)]
pub const fn timout(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Enable timeout"]
#[inline(always)]
pub const fn set_timout(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Wave shape"]
#[must_use]
#[inline(always)]
pub const fn wave(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Wave shape"]
#[inline(always)]
pub const fn set_wave(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Wave polarity"]
#[must_use]
#[inline(always)]
pub const fn wavpol(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Wave polarity"]
#[inline(always)]
pub const fn set_wavpol(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Register update mode"]
#[must_use]
#[inline(always)]
pub const fn preload(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Register update mode"]
#[inline(always)]
pub const fn set_preload(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
#[doc = "Counter mode enable"]
#[must_use]
#[inline(always)]
pub const fn countmode(&self) -> bool {
let val = (self.0 >> 23usize) & 0x01;
val != 0
}
#[doc = "Counter mode enable"]
#[inline(always)]
pub const fn set_countmode(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
}
#[doc = "Counter mode enable"]
#[must_use]
#[inline(always)]
pub const fn enc(&self) -> bool {
let val = (self.0 >> 24usize) & 0x01;
val != 0
}
#[doc = "Counter mode enable"]
#[inline(always)]
pub const fn set_enc(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
}
#[doc = "Trigger out seletion"]
#[must_use]
#[inline(always)]
pub const fn trgosel(&self) -> u8 {
let val = (self.0 >> 25usize) & 0x03;
val as u8
}
#[doc = "Trigger out seletion"]
#[inline(always)]
pub const fn set_trgosel(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 25usize)) | (((val as u32) & 0x03) << 25usize);
}
}
impl Default for Cfgr {
#[inline(always)]
fn default() -> Cfgr {
Cfgr(0)
}
}
impl core::fmt::Debug for Cfgr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfgr")
.field("cksel", &self.cksel())
.field("ckpol", &self.ckpol())
.field("ckflt", &self.ckflt())
.field("trgflt", &self.trgflt())
.field("presc", &self.presc())
.field("trigsel", &self.trigsel())
.field("trigen", &self.trigen())
.field("timout", &self.timout())
.field("wave", &self.wave())
.field("wavpol", &self.wavpol())
.field("preload", &self.preload())
.field("countmode", &self.countmode())
.field("enc", &self.enc())
.field("trgosel", &self.trgosel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfgr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfgr {{ cksel: {=bool:?}, ckpol: {=u8:?}, ckflt: {=u8:?}, trgflt: {=u8:?}, presc: {=u8:?}, trigsel: {=u8:?}, trigen: {=u8:?}, timout: {=bool:?}, wave: {=bool:?}, wavpol: {=bool:?}, preload: {=bool:?}, countmode: {=bool:?}, enc: {=bool:?}, trgosel: {=u8:?} }}" , self . cksel () , self . ckpol () , self . ckflt () , self . trgflt () , self . presc () , self . trigsel () , self . trigen () , self . timout () , self . wave () , self . wavpol () , self . preload () , self . countmode () , self . enc () , self . trgosel ())
}
}
#[doc = "CFGR2"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfgr2(pub u32);
impl Cfgr2 {
#[doc = "LPTIM input1 selection"]
#[must_use]
#[inline(always)]
pub const fn in1sel(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "LPTIM input1 selection"]
#[inline(always)]
pub const fn set_in1sel(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "LPTIM input2 selection"]
#[must_use]
#[inline(always)]
pub const fn in2sel(&self) -> u8 {
let val = (self.0 >> 4usize) & 0x03;
val as u8
}
#[doc = "LPTIM input2 selection"]
#[inline(always)]
pub const fn set_in2sel(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize);
}
}
impl Default for Cfgr2 {
#[inline(always)]
fn default() -> Cfgr2 {
Cfgr2(0)
}
}
impl core::fmt::Debug for Cfgr2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfgr2")
.field("in1sel", &self.in1sel())
.field("in2sel", &self.in2sel())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfgr2 {
fn format(&self, f: defmt::Formatter) {
defmt::write!(
f,
"Cfgr2 {{ in1sel: {=u8:?}, in2sel: {=u8:?} }}",
self.in1sel(),
self.in2sel()
)
}
}
#[doc = "CMP"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cmp(pub u32);
impl Cmp {
#[doc = "Compare value"]
#[must_use]
#[inline(always)]
pub const fn cmp(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Compare value"]
#[inline(always)]
pub const fn set_cmp(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
}
impl Default for Cmp {
#[inline(always)]
fn default() -> Cmp {
Cmp(0)
}
}
impl core::fmt::Debug for Cmp {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cmp").field("cmp", &self.cmp()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cmp {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Cmp {{ cmp: {=u16:?} }}", self.cmp())
}
}
#[doc = "CNT"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cnt(pub u32);
impl Cnt {
#[doc = "Counter value"]
#[must_use]
#[inline(always)]
pub const fn cnt(&self) -> u16 {
let val = (self.0 >> 0usize) & 0xffff;
val as u16
}
#[doc = "Counter value"]
#[inline(always)]
pub const fn set_cnt(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
}
}
impl Default for Cnt {
#[inline(always)]
fn default() -> Cnt {
Cnt(0)
}
}
impl core::fmt::Debug for Cnt {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cnt").field("cnt", &self.cnt()).finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cnt {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Cnt {{ cnt: {=u16:?} }}", self.cnt())
}
}
#[doc = "CR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cr(pub u32);
impl Cr {
#[doc = "LPTIM enable"]
#[must_use]
#[inline(always)]
pub const fn enable(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "LPTIM enable"]
#[inline(always)]
pub const fn set_enable(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Counter starts in single mode"]
#[must_use]
#[inline(always)]
pub const fn sngstrt(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Counter starts in single mode"]
#[inline(always)]
pub const fn set_sngstrt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Counter starts in consecutive mode"]
#[must_use]
#[inline(always)]
pub const fn cntstrt(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Counter starts in consecutive mode"]
#[inline(always)]
pub const fn set_cntstrt(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Counter reset"]
#[must_use]
#[inline(always)]
pub const fn countrst(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Counter reset"]
#[inline(always)]
pub const fn set_countrst(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Reset the LPTIM_CNT register by reading"]
#[must_use]
#[inline(always)]
pub const fn rstare(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Reset the LPTIM_CNT register by reading"]
#[inline(always)]
pub const fn set_rstare(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
}
impl Default for Cr {
#[inline(always)]
fn default() -> Cr {
Cr(0)
}
}
impl core::fmt::Debug for Cr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cr")
.field("enable", &self.enable())
.field("sngstrt", &self.sngstrt())
.field("cntstrt", &self.cntstrt())
.field("countrst", &self.countrst())
.field("rstare", &self.rstare())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cr {{ enable: {=bool:?}, sngstrt: {=bool:?}, cntstrt: {=bool:?}, countrst: {=bool:?}, rstare: {=bool:?} }}" , self . enable () , self . sngstrt () , self . cntstrt () , self . countrst () , self . rstare ())
}
}
#[doc = "ICR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Icr(pub u32);
impl Icr {
#[doc = "CMPM clear flag"]
#[must_use]
#[inline(always)]
pub const fn cmpmcf(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "CMPM clear flag"]
#[inline(always)]
pub const fn set_cmpmcf(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "ARRM clear flag"]
#[must_use]
#[inline(always)]
pub const fn arrmcf(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "ARRM clear flag"]
#[inline(always)]
pub const fn set_arrmcf(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "EXTTRIG clear flag"]
#[must_use]
#[inline(always)]
pub const fn exttrigcf(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "EXTTRIG clear flag"]
#[inline(always)]
pub const fn set_exttrigcf(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "CMPOK clear flag"]
#[must_use]
#[inline(always)]
pub const fn cmpokcf(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "CMPOK clear flag"]
#[inline(always)]
pub const fn set_cmpokcf(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "ARROK clear flag"]
#[must_use]
#[inline(always)]
pub const fn arrokcf(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "ARROK clear flag"]
#[inline(always)]
pub const fn set_arrokcf(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "UP clear flag"]
#[must_use]
#[inline(always)]
pub const fn upcf(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "UP clear flag"]
#[inline(always)]
pub const fn set_upcf(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "DOWN clear flag"]
#[must_use]
#[inline(always)]
pub const fn downcf(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "DOWN clear flag"]
#[inline(always)]
pub const fn set_downcf(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
}
impl Default for Icr {
#[inline(always)]
fn default() -> Icr {
Icr(0)
}
}
impl core::fmt::Debug for Icr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Icr")
.field("cmpmcf", &self.cmpmcf())
.field("arrmcf", &self.arrmcf())
.field("exttrigcf", &self.exttrigcf())
.field("cmpokcf", &self.cmpokcf())
.field("arrokcf", &self.arrokcf())
.field("upcf", &self.upcf())
.field("downcf", &self.downcf())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Icr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Icr {{ cmpmcf: {=bool:?}, arrmcf: {=bool:?}, exttrigcf: {=bool:?}, cmpokcf: {=bool:?}, arrokcf: {=bool:?}, upcf: {=bool:?}, downcf: {=bool:?} }}" , self . cmpmcf () , self . arrmcf () , self . exttrigcf () , self . cmpokcf () , self . arrokcf () , self . upcf () , self . downcf ())
}
}
#[doc = "IER"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ier(pub u32);
impl Ier {
#[doc = "CMPM interrupt enable"]
#[must_use]
#[inline(always)]
pub const fn cmpmie(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "CMPM interrupt enable"]
#[inline(always)]
pub const fn set_cmpmie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "ARRM interrupt enable"]
#[must_use]
#[inline(always)]
pub const fn arrmie(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "ARRM interrupt enable"]
#[inline(always)]
pub const fn set_arrmie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "EXTTRIG interrupt enable"]
#[must_use]
#[inline(always)]
pub const fn exttrigie(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "EXTTRIG interrupt enable"]
#[inline(always)]
pub const fn set_exttrigie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "CMPOK interrupt enable"]
#[must_use]
#[inline(always)]
pub const fn cmpokie(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "CMPOK interrupt enable"]
#[inline(always)]
pub const fn set_cmpokie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "ARROK interrupt enable"]
#[must_use]
#[inline(always)]
pub const fn arrokie(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "ARROK interrupt enable"]
#[inline(always)]
pub const fn set_arrokie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "UP interrupt enable"]
#[must_use]
#[inline(always)]
pub const fn upie(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "UP interrupt enable"]
#[inline(always)]
pub const fn set_upie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "DOWN interrupt enable"]
#[must_use]
#[inline(always)]
pub const fn downie(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "DOWN interrupt enable"]
#[inline(always)]
pub const fn set_downie(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
}
impl Default for Ier {
#[inline(always)]
fn default() -> Ier {
Ier(0)
}
}
impl core::fmt::Debug for Ier {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Ier")
.field("cmpmie", &self.cmpmie())
.field("arrmie", &self.arrmie())
.field("exttrigie", &self.exttrigie())
.field("cmpokie", &self.cmpokie())
.field("arrokie", &self.arrokie())
.field("upie", &self.upie())
.field("downie", &self.downie())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Ier {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Ier {{ cmpmie: {=bool:?}, arrmie: {=bool:?}, exttrigie: {=bool:?}, cmpokie: {=bool:?}, arrokie: {=bool:?}, upie: {=bool:?}, downie: {=bool:?} }}" , self . cmpmie () , self . arrmie () , self . exttrigie () , self . cmpokie () , self . arrokie () , self . upie () , self . downie ())
}
}
#[doc = "ISR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Isr(pub u32);
impl Isr {
#[doc = "Compare match"]
#[must_use]
#[inline(always)]
pub const fn cmpm(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Compare match"]
#[inline(always)]
pub const fn set_cmpm(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Auto reload"]
#[must_use]
#[inline(always)]
pub const fn arrm(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Auto reload"]
#[inline(always)]
pub const fn set_arrm(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "External trigger event"]
#[must_use]
#[inline(always)]
pub const fn exttrig(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "External trigger event"]
#[inline(always)]
pub const fn set_exttrig(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Compare register is written done"]
#[must_use]
#[inline(always)]
pub const fn cmpok(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Compare register is written done"]
#[inline(always)]
pub const fn set_cmpok(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Auto reload register is written done"]
#[must_use]
#[inline(always)]
pub const fn arrok(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Auto reload register is written done"]
#[inline(always)]
pub const fn set_arrok(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Counter direction change down to up"]
#[must_use]
#[inline(always)]
pub const fn up(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Counter direction change down to up"]
#[inline(always)]
pub const fn set_up(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Counter direction change up to down"]
#[must_use]
#[inline(always)]
pub const fn down(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Counter direction change up to down"]
#[inline(always)]
pub const fn set_down(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
}
impl Default for Isr {
#[inline(always)]
fn default() -> Isr {
Isr(0)
}
}
impl core::fmt::Debug for Isr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Isr")
.field("cmpm", &self.cmpm())
.field("arrm", &self.arrm())
.field("exttrig", &self.exttrig())
.field("cmpok", &self.cmpok())
.field("arrok", &self.arrok())
.field("up", &self.up())
.field("down", &self.down())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Isr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Isr {{ cmpm: {=bool:?}, arrm: {=bool:?}, exttrig: {=bool:?}, cmpok: {=bool:?}, arrok: {=bool:?}, up: {=bool:?}, down: {=bool:?} }}" , self . cmpm () , self . arrm () , self . exttrig () , self . cmpok () , self . arrok () , self . up () , self . down ())
}
}