pub type R = crate::R<CLKCRrs>;
pub type W = crate::W<CLKCRrs>;
pub type CLKDIV_R = crate::FieldReader<u16>;
pub type CLKDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
pub type PWRSAV_R = crate::BitReader;
pub type PWRSAV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type WIDBUS_R = crate::FieldReader;
pub type WIDBUS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type NEGEDGE_R = crate::BitReader;
pub type NEGEDGE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type HWFC_EN_R = crate::BitReader;
pub type HWFC_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DDR_R = crate::BitReader;
pub type DDR_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BUSSPEED_R = crate::BitReader;
pub type BUSSPEED_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SELCLKRX_R = crate::FieldReader;
pub type SELCLKRX_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
impl R {
#[inline(always)]
pub fn clkdiv(&self) -> CLKDIV_R {
CLKDIV_R::new((self.bits & 0x03ff) as u16)
}
#[inline(always)]
pub fn pwrsav(&self) -> PWRSAV_R {
PWRSAV_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn widbus(&self) -> WIDBUS_R {
WIDBUS_R::new(((self.bits >> 14) & 3) as u8)
}
#[inline(always)]
pub fn negedge(&self) -> NEGEDGE_R {
NEGEDGE_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn hwfc_en(&self) -> HWFC_EN_R {
HWFC_EN_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn ddr(&self) -> DDR_R {
DDR_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn busspeed(&self) -> BUSSPEED_R {
BUSSPEED_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn selclkrx(&self) -> SELCLKRX_R {
SELCLKRX_R::new(((self.bits >> 20) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CLKCR")
.field("clkdiv", &self.clkdiv())
.field("pwrsav", &self.pwrsav())
.field("widbus", &self.widbus())
.field("negedge", &self.negedge())
.field("hwfc_en", &self.hwfc_en())
.field("ddr", &self.ddr())
.field("busspeed", &self.busspeed())
.field("selclkrx", &self.selclkrx())
.finish()
}
}
impl W {
#[inline(always)]
pub fn clkdiv(&mut self) -> CLKDIV_W<CLKCRrs> {
CLKDIV_W::new(self, 0)
}
#[inline(always)]
pub fn pwrsav(&mut self) -> PWRSAV_W<CLKCRrs> {
PWRSAV_W::new(self, 12)
}
#[inline(always)]
pub fn widbus(&mut self) -> WIDBUS_W<CLKCRrs> {
WIDBUS_W::new(self, 14)
}
#[inline(always)]
pub fn negedge(&mut self) -> NEGEDGE_W<CLKCRrs> {
NEGEDGE_W::new(self, 16)
}
#[inline(always)]
pub fn hwfc_en(&mut self) -> HWFC_EN_W<CLKCRrs> {
HWFC_EN_W::new(self, 17)
}
#[inline(always)]
pub fn ddr(&mut self) -> DDR_W<CLKCRrs> {
DDR_W::new(self, 18)
}
#[inline(always)]
pub fn busspeed(&mut self) -> BUSSPEED_W<CLKCRrs> {
BUSSPEED_W::new(self, 19)
}
#[inline(always)]
pub fn selclkrx(&mut self) -> SELCLKRX_W<CLKCRrs> {
SELCLKRX_W::new(self, 20)
}
}
pub struct CLKCRrs;
impl crate::RegisterSpec for CLKCRrs {
type Ux = u32;
}
impl crate::Readable for CLKCRrs {}
impl crate::Writable for CLKCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CLKCRrs {}