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 SYNCOKIE {
Disabled = 0,
Enabled = 1,
}
impl From<SYNCOKIE> for bool {
#[inline(always)]
fn from(variant: SYNCOKIE) -> Self {
variant as u8 != 0
}
}
pub type SYNCOKIE_R = crate::BitReader<SYNCOKIE>;
impl SYNCOKIE_R {
#[inline(always)]
pub const fn variant(&self) -> SYNCOKIE {
match self.bits {
false => SYNCOKIE::Disabled,
true => SYNCOKIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SYNCOKIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SYNCOKIE::Enabled
}
}
pub type SYNCOKIE_W<'a, REG> = crate::BitWriter<'a, REG, SYNCOKIE>;
impl<'a, REG> SYNCOKIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SYNCOKIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SYNCOKIE::Enabled)
}
}
pub use SYNCOKIE_R as SYNCWARNIE_R;
pub use SYNCOKIE_R as ERRIE_R;
pub use SYNCOKIE_R as ESYNCIE_R;
pub use SYNCOKIE_W as SYNCWARNIE_W;
pub use SYNCOKIE_W as ERRIE_W;
pub use SYNCOKIE_W as ESYNCIE_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CEN {
Disabled = 0,
Enabled = 1,
}
impl From<CEN> for bool {
#[inline(always)]
fn from(variant: CEN) -> Self {
variant as u8 != 0
}
}
pub type CEN_R = crate::BitReader<CEN>;
impl CEN_R {
#[inline(always)]
pub const fn variant(&self) -> CEN {
match self.bits {
false => CEN::Disabled,
true => CEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CEN::Enabled
}
}
pub type CEN_W<'a, REG> = crate::BitWriter<'a, REG, CEN>;
impl<'a, REG> CEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AUTOTRIMEN {
Disabled = 0,
Enabled = 1,
}
impl From<AUTOTRIMEN> for bool {
#[inline(always)]
fn from(variant: AUTOTRIMEN) -> Self {
variant as u8 != 0
}
}
pub type AUTOTRIMEN_R = crate::BitReader<AUTOTRIMEN>;
impl AUTOTRIMEN_R {
#[inline(always)]
pub const fn variant(&self) -> AUTOTRIMEN {
match self.bits {
false => AUTOTRIMEN::Disabled,
true => AUTOTRIMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == AUTOTRIMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == AUTOTRIMEN::Enabled
}
}
pub type AUTOTRIMEN_W<'a, REG> = crate::BitWriter<'a, REG, AUTOTRIMEN>;
impl<'a, REG> AUTOTRIMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(AUTOTRIMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(AUTOTRIMEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SWSYNC {
Sync = 1,
}
impl From<SWSYNC> for bool {
#[inline(always)]
fn from(variant: SWSYNC) -> Self {
variant as u8 != 0
}
}
pub type SWSYNC_R = crate::BitReader<SWSYNC>;
impl SWSYNC_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SWSYNC> {
match self.bits {
true => Some(SWSYNC::Sync),
_ => None,
}
}
#[inline(always)]
pub fn is_sync(&self) -> bool {
*self == SWSYNC::Sync
}
}
pub type SWSYNC_W<'a, REG> = crate::BitWriter<'a, REG, SWSYNC>;
impl<'a, REG> SWSYNC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn sync(self) -> &'a mut crate::W<REG> {
self.variant(SWSYNC::Sync)
}
}
pub type TRIM_R = crate::FieldReader;
pub type TRIM_W<'a, REG> = crate::FieldWriter<'a, REG, 6, u8, crate::Safe>;
impl R {
#[inline(always)]
pub fn syncokie(&self) -> SYNCOKIE_R {
SYNCOKIE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn syncwarnie(&self) -> SYNCWARNIE_R {
SYNCWARNIE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn errie(&self) -> ERRIE_R {
ERRIE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn esyncie(&self) -> ESYNCIE_R {
ESYNCIE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn cen(&self) -> CEN_R {
CEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn autotrimen(&self) -> AUTOTRIMEN_R {
AUTOTRIMEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn swsync(&self) -> SWSYNC_R {
SWSYNC_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn trim(&self) -> TRIM_R {
TRIM_R::new(((self.bits >> 8) & 0x3f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("trim", &self.trim())
.field("swsync", &self.swsync())
.field("autotrimen", &self.autotrimen())
.field("cen", &self.cen())
.field("syncokie", &self.syncokie())
.field("esyncie", &self.esyncie())
.field("errie", &self.errie())
.field("syncwarnie", &self.syncwarnie())
.finish()
}
}
impl W {
#[inline(always)]
pub fn syncokie(&mut self) -> SYNCOKIE_W<CRrs> {
SYNCOKIE_W::new(self, 0)
}
#[inline(always)]
pub fn syncwarnie(&mut self) -> SYNCWARNIE_W<CRrs> {
SYNCWARNIE_W::new(self, 1)
}
#[inline(always)]
pub fn errie(&mut self) -> ERRIE_W<CRrs> {
ERRIE_W::new(self, 2)
}
#[inline(always)]
pub fn esyncie(&mut self) -> ESYNCIE_W<CRrs> {
ESYNCIE_W::new(self, 3)
}
#[inline(always)]
pub fn cen(&mut self) -> CEN_W<CRrs> {
CEN_W::new(self, 5)
}
#[inline(always)]
pub fn autotrimen(&mut self) -> AUTOTRIMEN_W<CRrs> {
AUTOTRIMEN_W::new(self, 6)
}
#[inline(always)]
pub fn swsync(&mut self) -> SWSYNC_W<CRrs> {
SWSYNC_W::new(self, 7)
}
#[inline(always)]
pub fn trim(&mut self) -> TRIM_W<CRrs> {
TRIM_W::new(self, 8)
}
}
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 = 0x2000;
}