pub type R = crate::R<CRrs>;
pub type W = crate::W<CRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HSION {
Off = 0,
On = 1,
}
impl From<HSION> for bool {
#[inline(always)]
fn from(variant: HSION) -> Self {
variant as u8 != 0
}
}
pub type HSION_R = crate::BitReader<HSION>;
impl HSION_R {
#[inline(always)]
pub const fn variant(&self) -> HSION {
match self.bits {
false => HSION::Off,
true => HSION::On,
}
}
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == HSION::Off
}
#[inline(always)]
pub fn is_on(&self) -> bool {
*self == HSION::On
}
}
pub type HSION_W<'a, REG> = crate::BitWriter<'a, REG, HSION>;
impl<'a, REG> HSION_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn off(self) -> &'a mut crate::W<REG> {
self.variant(HSION::Off)
}
#[inline(always)]
pub fn on(self) -> &'a mut crate::W<REG> {
self.variant(HSION::On)
}
}
pub type HSIKERON_R = crate::BitReader;
pub type HSIKERON_W<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HSIRDYR {
NotReady = 0,
Ready = 1,
}
impl From<HSIRDYR> for bool {
#[inline(always)]
fn from(variant: HSIRDYR) -> Self {
variant as u8 != 0
}
}
pub type HSIRDY_R = crate::BitReader<HSIRDYR>;
impl HSIRDY_R {
#[inline(always)]
pub const fn variant(&self) -> HSIRDYR {
match self.bits {
false => HSIRDYR::NotReady,
true => HSIRDYR::Ready,
}
}
#[inline(always)]
pub fn is_not_ready(&self) -> bool {
*self == HSIRDYR::NotReady
}
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == HSIRDYR::Ready
}
}
pub use HSION_R as HSEON_R;
pub use HSION_W as HSEON_W;
pub use HSIRDY_R as HSERDY_R;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HSEBYP {
NotBypassed = 0,
Bypassed = 1,
}
impl From<HSEBYP> for bool {
#[inline(always)]
fn from(variant: HSEBYP) -> Self {
variant as u8 != 0
}
}
pub type HSEBYP_R = crate::BitReader<HSEBYP>;
impl HSEBYP_R {
#[inline(always)]
pub const fn variant(&self) -> HSEBYP {
match self.bits {
false => HSEBYP::NotBypassed,
true => HSEBYP::Bypassed,
}
}
#[inline(always)]
pub fn is_not_bypassed(&self) -> bool {
*self == HSEBYP::NotBypassed
}
#[inline(always)]
pub fn is_bypassed(&self) -> bool {
*self == HSEBYP::Bypassed
}
}
pub type HSEBYP_W<'a, REG> = crate::BitWriter<'a, REG, HSEBYP>;
impl<'a, REG> HSEBYP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_bypassed(self) -> &'a mut crate::W<REG> {
self.variant(HSEBYP::NotBypassed)
}
#[inline(always)]
pub fn bypassed(self) -> &'a mut crate::W<REG> {
self.variant(HSEBYP::Bypassed)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CSSON {
Off = 0,
On = 1,
}
impl From<CSSON> for bool {
#[inline(always)]
fn from(variant: CSSON) -> Self {
variant as u8 != 0
}
}
pub type CSSON_R = crate::BitReader<CSSON>;
impl CSSON_R {
#[inline(always)]
pub const fn variant(&self) -> CSSON {
match self.bits {
false => CSSON::Off,
true => CSSON::On,
}
}
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == CSSON::Off
}
#[inline(always)]
pub fn is_on(&self) -> bool {
*self == CSSON::On
}
}
pub type CSSON_W<'a, REG> = crate::BitWriter<'a, REG, CSSON>;
impl<'a, REG> CSSON_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn off(self) -> &'a mut crate::W<REG> {
self.variant(CSSON::Off)
}
#[inline(always)]
pub fn on(self) -> &'a mut crate::W<REG> {
self.variant(CSSON::On)
}
}
pub use HSION_R as PLLON_R;
pub use HSION_W as PLLON_W;
pub use HSIRDY_R as PLLRDY_R;
impl R {
#[inline(always)]
pub fn hsion(&self) -> HSION_R {
HSION_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn hsikeron(&self) -> HSIKERON_R {
HSIKERON_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn hsirdy(&self) -> HSIRDY_R {
HSIRDY_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn hseon(&self) -> HSEON_R {
HSEON_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn hserdy(&self) -> HSERDY_R {
HSERDY_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn hsebyp(&self) -> HSEBYP_R {
HSEBYP_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn csson(&self) -> CSSON_R {
CSSON_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn pllon(&self) -> PLLON_R {
PLLON_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn pllrdy(&self) -> PLLRDY_R {
PLLRDY_R::new(((self.bits >> 25) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("hsion", &self.hsion())
.field("hsikeron", &self.hsikeron())
.field("hsirdy", &self.hsirdy())
.field("hseon", &self.hseon())
.field("hserdy", &self.hserdy())
.field("hsebyp", &self.hsebyp())
.field("csson", &self.csson())
.field("pllon", &self.pllon())
.field("pllrdy", &self.pllrdy())
.finish()
}
}
impl W {
#[inline(always)]
pub fn hsion(&mut self) -> HSION_W<CRrs> {
HSION_W::new(self, 8)
}
#[inline(always)]
pub fn hsikeron(&mut self) -> HSIKERON_W<CRrs> {
HSIKERON_W::new(self, 9)
}
#[inline(always)]
pub fn hseon(&mut self) -> HSEON_W<CRrs> {
HSEON_W::new(self, 16)
}
#[inline(always)]
pub fn hsebyp(&mut self) -> HSEBYP_W<CRrs> {
HSEBYP_W::new(self, 18)
}
#[inline(always)]
pub fn csson(&mut self) -> CSSON_W<CRrs> {
CSSON_W::new(self, 19)
}
#[inline(always)]
pub fn pllon(&mut self) -> PLLON_W<CRrs> {
PLLON_W::new(self, 24)
}
}
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 {
const RESET_VALUE: u32 = 0x63;
}