pub type R = crate::R<APB1HRSTRrs>;
pub type W = crate::W<APB1HRSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CRSRST {
Reset = 1,
}
impl From<CRSRST> for bool {
#[inline(always)]
fn from(variant: CRSRST) -> Self {
variant as u8 != 0
}
}
pub type CRSRST_R = crate::BitReader<CRSRST>;
impl CRSRST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CRSRST> {
match self.bits {
true => Some(CRSRST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == CRSRST::Reset
}
}
pub type CRSRST_W<'a, REG> = crate::BitWriter<'a, REG, CRSRST>;
impl<'a, REG> CRSRST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(CRSRST::Reset)
}
}
pub use CRSRST_R as SWPRST_R;
pub use CRSRST_R as OPAMPRST_R;
pub use CRSRST_R as MDIOSRST_R;
pub use CRSRST_R as FDCANRST_R;
pub use CRSRST_W as SWPRST_W;
pub use CRSRST_W as OPAMPRST_W;
pub use CRSRST_W as MDIOSRST_W;
pub use CRSRST_W as FDCANRST_W;
impl R {
#[inline(always)]
pub fn crsrst(&self) -> CRSRST_R {
CRSRST_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn swprst(&self) -> SWPRST_R {
SWPRST_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn opamprst(&self) -> OPAMPRST_R {
OPAMPRST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn mdiosrst(&self) -> MDIOSRST_R {
MDIOSRST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn fdcanrst(&self) -> FDCANRST_R {
FDCANRST_R::new(((self.bits >> 8) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB1HRSTR")
.field("crsrst", &self.crsrst())
.field("swprst", &self.swprst())
.field("opamprst", &self.opamprst())
.field("mdiosrst", &self.mdiosrst())
.field("fdcanrst", &self.fdcanrst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn crsrst(&mut self) -> CRSRST_W<APB1HRSTRrs> {
CRSRST_W::new(self, 1)
}
#[inline(always)]
pub fn swprst(&mut self) -> SWPRST_W<APB1HRSTRrs> {
SWPRST_W::new(self, 2)
}
#[inline(always)]
pub fn opamprst(&mut self) -> OPAMPRST_W<APB1HRSTRrs> {
OPAMPRST_W::new(self, 4)
}
#[inline(always)]
pub fn mdiosrst(&mut self) -> MDIOSRST_W<APB1HRSTRrs> {
MDIOSRST_W::new(self, 5)
}
#[inline(always)]
pub fn fdcanrst(&mut self) -> FDCANRST_W<APB1HRSTRrs> {
FDCANRST_W::new(self, 8)
}
}
pub struct APB1HRSTRrs;
impl crate::RegisterSpec for APB1HRSTRrs {
type Ux = u32;
}
impl crate::Readable for APB1HRSTRrs {}
impl crate::Writable for APB1HRSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for APB1HRSTRrs {}