pub type R = crate::R<CALRrs>;
pub type W = crate::W<CALRrs>;
pub type CALM_R = crate::FieldReader<u16>;
pub type CALM_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CALW16 {
SixteenSecond = 1,
}
impl From<CALW16> for bool {
#[inline(always)]
fn from(variant: CALW16) -> Self {
variant as u8 != 0
}
}
pub type CALW16_R = crate::BitReader<CALW16>;
impl CALW16_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CALW16> {
match self.bits {
true => Some(CALW16::SixteenSecond),
_ => None,
}
}
#[inline(always)]
pub fn is_sixteen_second(&self) -> bool {
*self == CALW16::SixteenSecond
}
}
pub type CALW16_W<'a, REG> = crate::BitWriter<'a, REG, CALW16>;
impl<'a, REG> CALW16_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn sixteen_second(self) -> &'a mut crate::W<REG> {
self.variant(CALW16::SixteenSecond)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CALW8 {
EightSecond = 1,
}
impl From<CALW8> for bool {
#[inline(always)]
fn from(variant: CALW8) -> Self {
variant as u8 != 0
}
}
pub type CALW8_R = crate::BitReader<CALW8>;
impl CALW8_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CALW8> {
match self.bits {
true => Some(CALW8::EightSecond),
_ => None,
}
}
#[inline(always)]
pub fn is_eight_second(&self) -> bool {
*self == CALW8::EightSecond
}
}
pub type CALW8_W<'a, REG> = crate::BitWriter<'a, REG, CALW8>;
impl<'a, REG> CALW8_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn eight_second(self) -> &'a mut crate::W<REG> {
self.variant(CALW8::EightSecond)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CALP {
NoChange = 0,
IncreaseFreq = 1,
}
impl From<CALP> for bool {
#[inline(always)]
fn from(variant: CALP) -> Self {
variant as u8 != 0
}
}
pub type CALP_R = crate::BitReader<CALP>;
impl CALP_R {
#[inline(always)]
pub const fn variant(&self) -> CALP {
match self.bits {
false => CALP::NoChange,
true => CALP::IncreaseFreq,
}
}
#[inline(always)]
pub fn is_no_change(&self) -> bool {
*self == CALP::NoChange
}
#[inline(always)]
pub fn is_increase_freq(&self) -> bool {
*self == CALP::IncreaseFreq
}
}
pub type CALP_W<'a, REG> = crate::BitWriter<'a, REG, CALP>;
impl<'a, REG> CALP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_change(self) -> &'a mut crate::W<REG> {
self.variant(CALP::NoChange)
}
#[inline(always)]
pub fn increase_freq(self) -> &'a mut crate::W<REG> {
self.variant(CALP::IncreaseFreq)
}
}
impl R {
#[inline(always)]
pub fn calm(&self) -> CALM_R {
CALM_R::new((self.bits & 0x01ff) as u16)
}
#[inline(always)]
pub fn calw16(&self) -> CALW16_R {
CALW16_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn calw8(&self) -> CALW8_R {
CALW8_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn calp(&self) -> CALP_R {
CALP_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CALR")
.field("calp", &self.calp())
.field("calw8", &self.calw8())
.field("calw16", &self.calw16())
.field("calm", &self.calm())
.finish()
}
}
impl W {
#[inline(always)]
pub fn calm(&mut self) -> CALM_W<CALRrs> {
CALM_W::new(self, 0)
}
#[inline(always)]
pub fn calw16(&mut self) -> CALW16_W<CALRrs> {
CALW16_W::new(self, 13)
}
#[inline(always)]
pub fn calw8(&mut self) -> CALW8_W<CALRrs> {
CALW8_W::new(self, 14)
}
#[inline(always)]
pub fn calp(&mut self) -> CALP_W<CALRrs> {
CALP_W::new(self, 15)
}
}
pub struct CALRrs;
impl crate::RegisterSpec for CALRrs {
type Ux = u32;
}
impl crate::Readable for CALRrs {}
impl crate::Writable for CALRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CALRrs {}