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 ENABLE {
Disabled = 0,
Enabled = 1,
}
impl From<ENABLE> for bool {
#[inline(always)]
fn from(variant: ENABLE) -> Self {
variant as u8 != 0
}
}
pub type ENABLE_R = crate::BitReader<ENABLE>;
impl ENABLE_R {
#[inline(always)]
pub const fn variant(&self) -> ENABLE {
match self.bits {
false => ENABLE::Disabled,
true => ENABLE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ENABLE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ENABLE::Enabled
}
}
pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG, ENABLE>;
impl<'a, REG> ENABLE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ENABLE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ENABLE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SNGSTRTW {
Start = 1,
}
impl From<SNGSTRTW> for bool {
#[inline(always)]
fn from(variant: SNGSTRTW) -> Self {
variant as u8 != 0
}
}
pub type SNGSTRT_R = crate::BitReader<SNGSTRTW>;
impl SNGSTRT_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SNGSTRTW> {
match self.bits {
true => Some(SNGSTRTW::Start),
_ => None,
}
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == SNGSTRTW::Start
}
}
pub type SNGSTRT_W<'a, REG> = crate::BitWriter<'a, REG, SNGSTRTW>;
impl<'a, REG> SNGSTRT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn start(self) -> &'a mut crate::W<REG> {
self.variant(SNGSTRTW::Start)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CNTSTRTW {
Start = 1,
}
impl From<CNTSTRTW> for bool {
#[inline(always)]
fn from(variant: CNTSTRTW) -> Self {
variant as u8 != 0
}
}
pub type CNTSTRT_R = crate::BitReader<CNTSTRTW>;
impl CNTSTRT_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CNTSTRTW> {
match self.bits {
true => Some(CNTSTRTW::Start),
_ => None,
}
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == CNTSTRTW::Start
}
}
pub type CNTSTRT_W<'a, REG> = crate::BitWriter<'a, REG, CNTSTRTW>;
impl<'a, REG> CNTSTRT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn start(self) -> &'a mut crate::W<REG> {
self.variant(CNTSTRTW::Start)
}
}
impl R {
#[inline(always)]
pub fn enable(&self) -> ENABLE_R {
ENABLE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn sngstrt(&self) -> SNGSTRT_R {
SNGSTRT_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cntstrt(&self) -> CNTSTRT_R {
CNTSTRT_R::new(((self.bits >> 2) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("cntstrt", &self.cntstrt())
.field("sngstrt", &self.sngstrt())
.field("enable", &self.enable())
.finish()
}
}
impl W {
#[inline(always)]
pub fn enable(&mut self) -> ENABLE_W<CRrs> {
ENABLE_W::new(self, 0)
}
#[inline(always)]
pub fn sngstrt(&mut self) -> SNGSTRT_W<CRrs> {
SNGSTRT_W::new(self, 1)
}
#[inline(always)]
pub fn cntstrt(&mut self) -> CNTSTRT_W<CRrs> {
CNTSTRT_W::new(self, 2)
}
}
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 {}