pub type R = crate::R<CRrs>;
pub type W = crate::W<CRrs>;
pub type CKPSC_R = crate::FieldReader;
pub type CKPSC_W<'a, REG> = crate::FieldWriter<'a, REG, 3, u8, crate::Safe>;
pub use crate::stm32h757cm4::hrtim_master::cr::CONT;
pub use crate::stm32h757cm4::hrtim_master::cr::CONT_R;
pub use crate::stm32h757cm4::hrtim_master::cr::CONT_W;
pub use crate::stm32h757cm4::hrtim_master::cr::HALF;
pub use crate::stm32h757cm4::hrtim_master::cr::HALF_R;
pub use crate::stm32h757cm4::hrtim_master::cr::HALF_W;
pub use crate::stm32h757cm4::hrtim_master::cr::RETRIG;
pub use crate::stm32h757cm4::hrtim_master::cr::RETRIG_R;
pub use crate::stm32h757cm4::hrtim_master::cr::RETRIG_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PSHPLL {
Disabled = 0,
Enabled = 1,
}
impl From<PSHPLL> for bool {
#[inline(always)]
fn from(variant: PSHPLL) -> Self {
variant as u8 != 0
}
}
pub type PSHPLL_R = crate::BitReader<PSHPLL>;
impl PSHPLL_R {
#[inline(always)]
pub const fn variant(&self) -> PSHPLL {
match self.bits {
false => PSHPLL::Disabled,
true => PSHPLL::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PSHPLL::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PSHPLL::Enabled
}
}
pub type PSHPLL_W<'a, REG> = crate::BitWriter<'a, REG, PSHPLL>;
impl<'a, REG> PSHPLL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PSHPLL::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PSHPLL::Enabled)
}
}
pub use crate::stm32h757cm4::hrtim_master::cr::SYNCRST;
pub use crate::stm32h757cm4::hrtim_master::cr::SYNCRST_R;
pub use crate::stm32h757cm4::hrtim_master::cr::SYNCRST_W;
pub use crate::stm32h757cm4::hrtim_master::cr::SYNCSTRT;
pub use crate::stm32h757cm4::hrtim_master::cr::SYNCSTRT_R;
pub use crate::stm32h757cm4::hrtim_master::cr::SYNCSTRT_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DELCMP2 {
Standard = 0,
Capture1 = 1,
Capture1Compare1 = 2,
Capture1Compare3 = 3,
}
impl From<DELCMP2> for u8 {
#[inline(always)]
fn from(variant: DELCMP2) -> Self {
variant as _
}
}
impl crate::FieldSpec for DELCMP2 {
type Ux = u8;
}
impl crate::IsEnum for DELCMP2 {}
pub type DELCMP2_R = crate::FieldReader<DELCMP2>;
impl DELCMP2_R {
#[inline(always)]
pub const fn variant(&self) -> DELCMP2 {
match self.bits {
0 => DELCMP2::Standard,
1 => DELCMP2::Capture1,
2 => DELCMP2::Capture1Compare1,
3 => DELCMP2::Capture1Compare3,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == DELCMP2::Standard
}
#[inline(always)]
pub fn is_capture1(&self) -> bool {
*self == DELCMP2::Capture1
}
#[inline(always)]
pub fn is_capture1_compare1(&self) -> bool {
*self == DELCMP2::Capture1Compare1
}
#[inline(always)]
pub fn is_capture1_compare3(&self) -> bool {
*self == DELCMP2::Capture1Compare3
}
}
pub type DELCMP2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DELCMP2, crate::Safe>;
impl<'a, REG> DELCMP2_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP2::Standard)
}
#[inline(always)]
pub fn capture1(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP2::Capture1)
}
#[inline(always)]
pub fn capture1_compare1(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP2::Capture1Compare1)
}
#[inline(always)]
pub fn capture1_compare3(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP2::Capture1Compare3)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DELCMP4 {
Standard = 0,
Capture2 = 1,
Capture2Compare1 = 2,
CaptureCompare3 = 3,
}
impl From<DELCMP4> for u8 {
#[inline(always)]
fn from(variant: DELCMP4) -> Self {
variant as _
}
}
impl crate::FieldSpec for DELCMP4 {
type Ux = u8;
}
impl crate::IsEnum for DELCMP4 {}
pub type DELCMP4_R = crate::FieldReader<DELCMP4>;
impl DELCMP4_R {
#[inline(always)]
pub const fn variant(&self) -> DELCMP4 {
match self.bits {
0 => DELCMP4::Standard,
1 => DELCMP4::Capture2,
2 => DELCMP4::Capture2Compare1,
3 => DELCMP4::CaptureCompare3,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == DELCMP4::Standard
}
#[inline(always)]
pub fn is_capture2(&self) -> bool {
*self == DELCMP4::Capture2
}
#[inline(always)]
pub fn is_capture2_compare1(&self) -> bool {
*self == DELCMP4::Capture2Compare1
}
#[inline(always)]
pub fn is_capture_compare3(&self) -> bool {
*self == DELCMP4::CaptureCompare3
}
}
pub type DELCMP4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DELCMP4, crate::Safe>;
impl<'a, REG> DELCMP4_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP4::Standard)
}
#[inline(always)]
pub fn capture2(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP4::Capture2)
}
#[inline(always)]
pub fn capture2_compare1(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP4::Capture2Compare1)
}
#[inline(always)]
pub fn capture_compare3(self) -> &'a mut crate::W<REG> {
self.variant(DELCMP4::CaptureCompare3)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TREPU {
Disabled = 0,
Enabled = 1,
}
impl From<TREPU> for bool {
#[inline(always)]
fn from(variant: TREPU) -> Self {
variant as u8 != 0
}
}
pub type TREPU_R = crate::BitReader<TREPU>;
impl TREPU_R {
#[inline(always)]
pub const fn variant(&self) -> TREPU {
match self.bits {
false => TREPU::Disabled,
true => TREPU::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TREPU::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TREPU::Enabled
}
}
pub type TREPU_W<'a, REG> = crate::BitWriter<'a, REG, TREPU>;
impl<'a, REG> TREPU_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TREPU::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TREPU::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TRSTU {
Disabled = 0,
Enabled = 1,
}
impl From<TRSTU> for bool {
#[inline(always)]
fn from(variant: TRSTU) -> Self {
variant as u8 != 0
}
}
pub type TRSTU_R = crate::BitReader<TRSTU>;
impl TRSTU_R {
#[inline(always)]
pub const fn variant(&self) -> TRSTU {
match self.bits {
false => TRSTU::Disabled,
true => TRSTU::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TRSTU::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TRSTU::Enabled
}
}
pub type TRSTU_W<'a, REG> = crate::BitWriter<'a, REG, TRSTU>;
impl<'a, REG> TRSTU_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TRSTU::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TRSTU::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TBU {
Disabled = 0,
Enabled = 1,
}
impl From<TBU> for bool {
#[inline(always)]
fn from(variant: TBU) -> Self {
variant as u8 != 0
}
}
pub type TBU_R = crate::BitReader<TBU>;
impl TBU_R {
#[inline(always)]
pub const fn variant(&self) -> TBU {
match self.bits {
false => TBU::Disabled,
true => TBU::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TBU::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TBU::Enabled
}
}
pub type TBU_W<'a, REG> = crate::BitWriter<'a, REG, TBU>;
impl<'a, REG> TBU_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TBU::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TBU::Enabled)
}
}
pub use TBU_R as TCU_R;
pub use TBU_R as TDU_R;
pub use TBU_R as TEU_R;
pub use TBU_W as TCU_W;
pub use TBU_W as TDU_W;
pub use TBU_W as TEU_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MSTU {
Disabled = 0,
Enabled = 1,
}
impl From<MSTU> for bool {
#[inline(always)]
fn from(variant: MSTU) -> Self {
variant as u8 != 0
}
}
pub type MSTU_R = crate::BitReader<MSTU>;
impl MSTU_R {
#[inline(always)]
pub const fn variant(&self) -> MSTU {
match self.bits {
false => MSTU::Disabled,
true => MSTU::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == MSTU::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == MSTU::Enabled
}
}
pub type MSTU_W<'a, REG> = crate::BitWriter<'a, REG, MSTU>;
impl<'a, REG> MSTU_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(MSTU::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(MSTU::Enabled)
}
}
pub use crate::stm32h757cm4::hrtim_master::cr::DACSYNC;
pub use crate::stm32h757cm4::hrtim_master::cr::DACSYNC_R;
pub use crate::stm32h757cm4::hrtim_master::cr::DACSYNC_W;
pub use crate::stm32h757cm4::hrtim_master::cr::PREEN;
pub use crate::stm32h757cm4::hrtim_master::cr::PREEN_R;
pub use crate::stm32h757cm4::hrtim_master::cr::PREEN_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum UPDGAT {
Independent = 0,
Dmaburst = 1,
DmaburstUpdate = 2,
Input1 = 3,
Input2 = 4,
Input3 = 5,
Input1Update = 6,
Input2Update = 7,
Input3Update = 8,
}
impl From<UPDGAT> for u8 {
#[inline(always)]
fn from(variant: UPDGAT) -> Self {
variant as _
}
}
impl crate::FieldSpec for UPDGAT {
type Ux = u8;
}
impl crate::IsEnum for UPDGAT {}
pub type UPDGAT_R = crate::FieldReader<UPDGAT>;
impl UPDGAT_R {
#[inline(always)]
pub const fn variant(&self) -> Option<UPDGAT> {
match self.bits {
0 => Some(UPDGAT::Independent),
1 => Some(UPDGAT::Dmaburst),
2 => Some(UPDGAT::DmaburstUpdate),
3 => Some(UPDGAT::Input1),
4 => Some(UPDGAT::Input2),
5 => Some(UPDGAT::Input3),
6 => Some(UPDGAT::Input1Update),
7 => Some(UPDGAT::Input2Update),
8 => Some(UPDGAT::Input3Update),
_ => None,
}
}
#[inline(always)]
pub fn is_independent(&self) -> bool {
*self == UPDGAT::Independent
}
#[inline(always)]
pub fn is_dmaburst(&self) -> bool {
*self == UPDGAT::Dmaburst
}
#[inline(always)]
pub fn is_dmaburst_update(&self) -> bool {
*self == UPDGAT::DmaburstUpdate
}
#[inline(always)]
pub fn is_input1(&self) -> bool {
*self == UPDGAT::Input1
}
#[inline(always)]
pub fn is_input2(&self) -> bool {
*self == UPDGAT::Input2
}
#[inline(always)]
pub fn is_input3(&self) -> bool {
*self == UPDGAT::Input3
}
#[inline(always)]
pub fn is_input1_update(&self) -> bool {
*self == UPDGAT::Input1Update
}
#[inline(always)]
pub fn is_input2_update(&self) -> bool {
*self == UPDGAT::Input2Update
}
#[inline(always)]
pub fn is_input3_update(&self) -> bool {
*self == UPDGAT::Input3Update
}
}
pub type UPDGAT_W<'a, REG> = crate::FieldWriter<'a, REG, 4, UPDGAT>;
impl<'a, REG> UPDGAT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn independent(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Independent)
}
#[inline(always)]
pub fn dmaburst(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Dmaburst)
}
#[inline(always)]
pub fn dmaburst_update(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::DmaburstUpdate)
}
#[inline(always)]
pub fn input1(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Input1)
}
#[inline(always)]
pub fn input2(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Input2)
}
#[inline(always)]
pub fn input3(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Input3)
}
#[inline(always)]
pub fn input1_update(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Input1Update)
}
#[inline(always)]
pub fn input2_update(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Input2Update)
}
#[inline(always)]
pub fn input3_update(self) -> &'a mut crate::W<REG> {
self.variant(UPDGAT::Input3Update)
}
}
impl R {
#[inline(always)]
pub fn ckpsc(&self) -> CKPSC_R {
CKPSC_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn cont(&self) -> CONT_R {
CONT_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn retrig(&self) -> RETRIG_R {
RETRIG_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn half(&self) -> HALF_R {
HALF_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn pshpll(&self) -> PSHPLL_R {
PSHPLL_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn syncrst(&self) -> SYNCRST_R {
SYNCRST_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn syncstrt(&self) -> SYNCSTRT_R {
SYNCSTRT_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn delcmp2(&self) -> DELCMP2_R {
DELCMP2_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn delcmp4(&self) -> DELCMP4_R {
DELCMP4_R::new(((self.bits >> 14) & 3) as u8)
}
#[inline(always)]
pub fn trepu(&self) -> TREPU_R {
TREPU_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn trstu(&self) -> TRSTU_R {
TRSTU_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn tbu(&self) -> TBU_R {
TBU_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn tcu(&self) -> TCU_R {
TCU_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn tdu(&self) -> TDU_R {
TDU_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn teu(&self) -> TEU_R {
TEU_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn mstu(&self) -> MSTU_R {
MSTU_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn dacsync(&self) -> DACSYNC_R {
DACSYNC_R::new(((self.bits >> 25) & 3) as u8)
}
#[inline(always)]
pub fn preen(&self) -> PREEN_R {
PREEN_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn updgat(&self) -> UPDGAT_R {
UPDGAT_R::new(((self.bits >> 28) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("updgat", &self.updgat())
.field("preen", &self.preen())
.field("dacsync", &self.dacsync())
.field("mstu", &self.mstu())
.field("tbu", &self.tbu())
.field("teu", &self.teu())
.field("tdu", &self.tdu())
.field("tcu", &self.tcu())
.field("trstu", &self.trstu())
.field("trepu", &self.trepu())
.field("delcmp4", &self.delcmp4())
.field("delcmp2", &self.delcmp2())
.field("syncstrt", &self.syncstrt())
.field("syncrst", &self.syncrst())
.field("pshpll", &self.pshpll())
.field("half", &self.half())
.field("retrig", &self.retrig())
.field("cont", &self.cont())
.field("ckpsc", &self.ckpsc())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ckpsc(&mut self) -> CKPSC_W<CRrs> {
CKPSC_W::new(self, 0)
}
#[inline(always)]
pub fn cont(&mut self) -> CONT_W<CRrs> {
CONT_W::new(self, 3)
}
#[inline(always)]
pub fn retrig(&mut self) -> RETRIG_W<CRrs> {
RETRIG_W::new(self, 4)
}
#[inline(always)]
pub fn half(&mut self) -> HALF_W<CRrs> {
HALF_W::new(self, 5)
}
#[inline(always)]
pub fn pshpll(&mut self) -> PSHPLL_W<CRrs> {
PSHPLL_W::new(self, 6)
}
#[inline(always)]
pub fn syncrst(&mut self) -> SYNCRST_W<CRrs> {
SYNCRST_W::new(self, 10)
}
#[inline(always)]
pub fn syncstrt(&mut self) -> SYNCSTRT_W<CRrs> {
SYNCSTRT_W::new(self, 11)
}
#[inline(always)]
pub fn delcmp2(&mut self) -> DELCMP2_W<CRrs> {
DELCMP2_W::new(self, 12)
}
#[inline(always)]
pub fn delcmp4(&mut self) -> DELCMP4_W<CRrs> {
DELCMP4_W::new(self, 14)
}
#[inline(always)]
pub fn trepu(&mut self) -> TREPU_W<CRrs> {
TREPU_W::new(self, 17)
}
#[inline(always)]
pub fn trstu(&mut self) -> TRSTU_W<CRrs> {
TRSTU_W::new(self, 18)
}
#[inline(always)]
pub fn tbu(&mut self) -> TBU_W<CRrs> {
TBU_W::new(self, 20)
}
#[inline(always)]
pub fn tcu(&mut self) -> TCU_W<CRrs> {
TCU_W::new(self, 21)
}
#[inline(always)]
pub fn tdu(&mut self) -> TDU_W<CRrs> {
TDU_W::new(self, 22)
}
#[inline(always)]
pub fn teu(&mut self) -> TEU_W<CRrs> {
TEU_W::new(self, 23)
}
#[inline(always)]
pub fn mstu(&mut self) -> MSTU_W<CRrs> {
MSTU_W::new(self, 24)
}
#[inline(always)]
pub fn dacsync(&mut self) -> DACSYNC_W<CRrs> {
DACSYNC_W::new(self, 25)
}
#[inline(always)]
pub fn preen(&mut self) -> PREEN_W<CRrs> {
PREEN_W::new(self, 27)
}
#[inline(always)]
pub fn updgat(&mut self) -> UPDGAT_W<CRrs> {
UPDGAT_W::new(self, 28)
}
}
pub struct CRrs;
impl crate::RegisterSpec for CRrs {
type Ux = u32;
}
impl crate::Readable for CRrs {}
impl crate::Writable for CRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CRrs {}