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 LEN {
Disabled = 0,
Enabled = 1,
}
impl From<LEN> for bool {
#[inline(always)]
fn from(variant: LEN) -> Self {
variant as u8 != 0
}
}
pub type LEN_R = crate::BitReader<LEN>;
impl LEN_R {
#[inline(always)]
pub const fn variant(&self) -> LEN {
match self.bits {
false => LEN::Disabled,
true => LEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == LEN::Enabled
}
}
pub type LEN_W<'a, REG> = crate::BitWriter<'a, REG, LEN>;
impl<'a, REG> LEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(LEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum COLKEN {
Disabled = 0,
Enabled = 1,
}
impl From<COLKEN> for bool {
#[inline(always)]
fn from(variant: COLKEN) -> Self {
variant as u8 != 0
}
}
pub type COLKEN_R = crate::BitReader<COLKEN>;
impl COLKEN_R {
#[inline(always)]
pub const fn variant(&self) -> COLKEN {
match self.bits {
false => COLKEN::Disabled,
true => COLKEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == COLKEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == COLKEN::Enabled
}
}
pub type COLKEN_W<'a, REG> = crate::BitWriter<'a, REG, COLKEN>;
impl<'a, REG> COLKEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(COLKEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(COLKEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CLUTEN {
Disabled = 0,
Enabled = 1,
}
impl From<CLUTEN> for bool {
#[inline(always)]
fn from(variant: CLUTEN) -> Self {
variant as u8 != 0
}
}
pub type CLUTEN_R = crate::BitReader<CLUTEN>;
impl CLUTEN_R {
#[inline(always)]
pub const fn variant(&self) -> CLUTEN {
match self.bits {
false => CLUTEN::Disabled,
true => CLUTEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CLUTEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CLUTEN::Enabled
}
}
pub type CLUTEN_W<'a, REG> = crate::BitWriter<'a, REG, CLUTEN>;
impl<'a, REG> CLUTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CLUTEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CLUTEN::Enabled)
}
}
impl R {
#[inline(always)]
pub fn len(&self) -> LEN_R {
LEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn colken(&self) -> COLKEN_R {
COLKEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cluten(&self) -> CLUTEN_R {
CLUTEN_R::new(((self.bits >> 4) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("cluten", &self.cluten())
.field("colken", &self.colken())
.field("len", &self.len())
.finish()
}
}
impl W {
#[inline(always)]
pub fn len(&mut self) -> LEN_W<CRrs> {
LEN_W::new(self, 0)
}
#[inline(always)]
pub fn colken(&mut self) -> COLKEN_W<CRrs> {
COLKEN_W::new(self, 1)
}
#[inline(always)]
pub fn cluten(&mut self) -> CLUTEN_W<CRrs> {
CLUTEN_W::new(self, 4)
}
}
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 {}