pub type R = crate::R<ISRrs>;
pub use crate::stm32h745cm4::hrtim_master::isr::CMP1;
pub use crate::stm32h745cm4::hrtim_master::isr::CMP_R;
pub use crate::stm32h745cm4::hrtim_master::isr::REP;
pub use crate::stm32h745cm4::hrtim_master::isr::REP_R;
pub use crate::stm32h745cm4::hrtim_master::isr::UPD;
pub use crate::stm32h745cm4::hrtim_master::isr::UPD_R;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CPT1 {
NoEvent = 0,
Event = 1,
}
impl From<CPT1> for bool {
#[inline(always)]
fn from(variant: CPT1) -> Self {
variant as u8 != 0
}
}
pub type CPT_R = crate::BitReader<CPT1>;
impl CPT_R {
#[inline(always)]
pub const fn variant(&self) -> CPT1 {
match self.bits {
false => CPT1::NoEvent,
true => CPT1::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == CPT1::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == CPT1::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SET1 {
NoEvent = 0,
Event = 1,
}
impl From<SET1> for bool {
#[inline(always)]
fn from(variant: SET1) -> Self {
variant as u8 != 0
}
}
pub type SET_R = crate::BitReader<SET1>;
impl SET_R {
#[inline(always)]
pub const fn variant(&self) -> SET1 {
match self.bits {
false => SET1::NoEvent,
true => SET1::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == SET1::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == SET1::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RST1 {
NoEvent = 0,
Event = 1,
}
impl From<RST1> for bool {
#[inline(always)]
fn from(variant: RST1) -> Self {
variant as u8 != 0
}
}
pub type RST1_R = crate::BitReader<RST1>;
impl RST1_R {
#[inline(always)]
pub const fn variant(&self) -> RST1 {
match self.bits {
false => RST1::NoEvent,
true => RST1::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == RST1::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == RST1::Event
}
}
pub use RST1_R as RST2_R;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RST {
NoEvent = 0,
Event = 1,
}
impl From<RST> for bool {
#[inline(always)]
fn from(variant: RST) -> Self {
variant as u8 != 0
}
}
pub type RST_R = crate::BitReader<RST>;
impl RST_R {
#[inline(always)]
pub const fn variant(&self) -> RST {
match self.bits {
false => RST::NoEvent,
true => RST::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == RST::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == RST::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DLYPRT {
Inactive = 0,
Active = 1,
}
impl From<DLYPRT> for bool {
#[inline(always)]
fn from(variant: DLYPRT) -> Self {
variant as u8 != 0
}
}
pub type DLYPRT_R = crate::BitReader<DLYPRT>;
impl DLYPRT_R {
#[inline(always)]
pub const fn variant(&self) -> DLYPRT {
match self.bits {
false => DLYPRT::Inactive,
true => DLYPRT::Active,
}
}
#[inline(always)]
pub fn is_inactive(&self) -> bool {
*self == DLYPRT::Inactive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == DLYPRT::Active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CPPSTAT {
Output1active = 0,
Output2active = 1,
}
impl From<CPPSTAT> for bool {
#[inline(always)]
fn from(variant: CPPSTAT) -> Self {
variant as u8 != 0
}
}
pub type CPPSTAT_R = crate::BitReader<CPPSTAT>;
impl CPPSTAT_R {
#[inline(always)]
pub const fn variant(&self) -> CPPSTAT {
match self.bits {
false => CPPSTAT::Output1active,
true => CPPSTAT::Output2active,
}
}
#[inline(always)]
pub fn is_output1active(&self) -> bool {
*self == CPPSTAT::Output1active
}
#[inline(always)]
pub fn is_output2active(&self) -> bool {
*self == CPPSTAT::Output2active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IPPSTAT {
Output1active = 0,
Output2active = 1,
}
impl From<IPPSTAT> for bool {
#[inline(always)]
fn from(variant: IPPSTAT) -> Self {
variant as u8 != 0
}
}
pub type IPPSTAT_R = crate::BitReader<IPPSTAT>;
impl IPPSTAT_R {
#[inline(always)]
pub const fn variant(&self) -> IPPSTAT {
match self.bits {
false => IPPSTAT::Output1active,
true => IPPSTAT::Output2active,
}
}
#[inline(always)]
pub fn is_output1active(&self) -> bool {
*self == IPPSTAT::Output1active
}
#[inline(always)]
pub fn is_output2active(&self) -> bool {
*self == IPPSTAT::Output2active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum O1STAT {
Inactive = 0,
Active = 1,
}
impl From<O1STAT> for bool {
#[inline(always)]
fn from(variant: O1STAT) -> Self {
variant as u8 != 0
}
}
pub type O1STAT_R = crate::BitReader<O1STAT>;
impl O1STAT_R {
#[inline(always)]
pub const fn variant(&self) -> O1STAT {
match self.bits {
false => O1STAT::Inactive,
true => O1STAT::Active,
}
}
#[inline(always)]
pub fn is_inactive(&self) -> bool {
*self == O1STAT::Inactive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == O1STAT::Active
}
}
pub use O1STAT_R as O2STAT_R;
impl R {
#[inline(always)]
pub fn cmp(&self, n: u8) -> CMP_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CMP_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn cmp_iter(&self) -> impl Iterator<Item = CMP_R> + '_ {
(0..4).map(move |n| CMP_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn cmp1(&self) -> CMP_R {
CMP_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cmp2(&self) -> CMP_R {
CMP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cmp3(&self) -> CMP_R {
CMP_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn cmp4(&self) -> CMP_R {
CMP_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn rep(&self) -> REP_R {
REP_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn upd(&self) -> UPD_R {
UPD_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn cpt(&self, n: u8) -> CPT_R {
#[allow(clippy::no_effect)] [(); 2][n as usize];
CPT_R::new(((self.bits >> (n + 7)) & 1) != 0)
}
#[inline(always)]
pub fn cpt_iter(&self) -> impl Iterator<Item = CPT_R> + '_ {
(0..2).map(move |n| CPT_R::new(((self.bits >> (n + 7)) & 1) != 0))
}
#[inline(always)]
pub fn cpt1(&self) -> CPT_R {
CPT_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn cpt2(&self) -> CPT_R {
CPT_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn set_(&self, n: u8) -> SET_R {
#[allow(clippy::no_effect)] [(); 2][n as usize];
SET_R::new(((self.bits >> (n * 2 + 9)) & 1) != 0)
}
#[inline(always)]
pub fn set__iter(&self) -> impl Iterator<Item = SET_R> + '_ {
(0..2).map(move |n| SET_R::new(((self.bits >> (n * 2 + 9)) & 1) != 0))
}
#[inline(always)]
pub fn set1(&self) -> SET_R {
SET_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn set2(&self) -> SET_R {
SET_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn rst1(&self) -> RST1_R {
RST1_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn rst2(&self) -> RST2_R {
RST2_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn rst(&self) -> RST_R {
RST_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn dlyprt(&self) -> DLYPRT_R {
DLYPRT_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn cppstat(&self) -> CPPSTAT_R {
CPPSTAT_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn ippstat(&self) -> IPPSTAT_R {
IPPSTAT_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn o1stat(&self) -> O1STAT_R {
O1STAT_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn o2stat(&self) -> O2STAT_R {
O2STAT_R::new(((self.bits >> 19) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ISR")
.field("o1stat", &self.o1stat())
.field("o2stat", &self.o2stat())
.field("ippstat", &self.ippstat())
.field("cppstat", &self.cppstat())
.field("dlyprt", &self.dlyprt())
.field("rst", &self.rst())
.field("rst1", &self.rst1())
.field("rst2", &self.rst2())
.field("set1", &self.set1())
.field("set2", &self.set2())
.field("cpt1", &self.cpt1())
.field("cpt2", &self.cpt2())
.field("upd", &self.upd())
.field("rep", &self.rep())
.field("cmp1", &self.cmp1())
.field("cmp2", &self.cmp2())
.field("cmp3", &self.cmp3())
.field("cmp4", &self.cmp4())
.finish()
}
}
pub struct ISRrs;
impl crate::RegisterSpec for ISRrs {
type Ux = u32;
}
impl crate::Readable for ISRrs {}
impl crate::Resettable for ISRrs {}