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 TSCE {
Disabled = 0,
Enabled = 1,
}
impl From<TSCE> for bool {
#[inline(always)]
fn from(variant: TSCE) -> Self {
variant as u8 != 0
}
}
pub type TSCE_R = crate::BitReader<TSCE>;
impl TSCE_R {
#[inline(always)]
pub const fn variant(&self) -> TSCE {
match self.bits {
false => TSCE::Disabled,
true => TSCE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TSCE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TSCE::Enabled
}
}
pub type TSCE_W<'a, REG> = crate::BitWriter<'a, REG, TSCE>;
impl<'a, REG> TSCE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TSCE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TSCE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum START {
NoStarted = 0,
Started = 1,
}
impl From<START> for bool {
#[inline(always)]
fn from(variant: START) -> Self {
variant as u8 != 0
}
}
pub type START_R = crate::BitReader<START>;
impl START_R {
#[inline(always)]
pub const fn variant(&self) -> START {
match self.bits {
false => START::NoStarted,
true => START::Started,
}
}
#[inline(always)]
pub fn is_no_started(&self) -> bool {
*self == START::NoStarted
}
#[inline(always)]
pub fn is_started(&self) -> bool {
*self == START::Started
}
}
pub type START_W<'a, REG> = crate::BitWriter<'a, REG, START>;
impl<'a, REG> START_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_started(self) -> &'a mut crate::W<REG> {
self.variant(START::NoStarted)
}
#[inline(always)]
pub fn started(self) -> &'a mut crate::W<REG> {
self.variant(START::Started)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AM {
Normal = 0,
Synchronized = 1,
}
impl From<AM> for bool {
#[inline(always)]
fn from(variant: AM) -> Self {
variant as u8 != 0
}
}
pub type AM_R = crate::BitReader<AM>;
impl AM_R {
#[inline(always)]
pub const fn variant(&self) -> AM {
match self.bits {
false => AM::Normal,
true => AM::Synchronized,
}
}
#[inline(always)]
pub fn is_normal(&self) -> bool {
*self == AM::Normal
}
#[inline(always)]
pub fn is_synchronized(&self) -> bool {
*self == AM::Synchronized
}
}
pub type AM_W<'a, REG> = crate::BitWriter<'a, REG, AM>;
impl<'a, REG> AM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn normal(self) -> &'a mut crate::W<REG> {
self.variant(AM::Normal)
}
#[inline(always)]
pub fn synchronized(self) -> &'a mut crate::W<REG> {
self.variant(AM::Synchronized)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SYNCPOL {
FallingEdge = 0,
RisingEdge = 1,
}
impl From<SYNCPOL> for bool {
#[inline(always)]
fn from(variant: SYNCPOL) -> Self {
variant as u8 != 0
}
}
pub type SYNCPOL_R = crate::BitReader<SYNCPOL>;
impl SYNCPOL_R {
#[inline(always)]
pub const fn variant(&self) -> SYNCPOL {
match self.bits {
false => SYNCPOL::FallingEdge,
true => SYNCPOL::RisingEdge,
}
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == SYNCPOL::FallingEdge
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == SYNCPOL::RisingEdge
}
}
pub type SYNCPOL_W<'a, REG> = crate::BitWriter<'a, REG, SYNCPOL>;
impl<'a, REG> SYNCPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(SYNCPOL::FallingEdge)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(SYNCPOL::RisingEdge)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IODEF {
PushPull = 0,
Floating = 1,
}
impl From<IODEF> for bool {
#[inline(always)]
fn from(variant: IODEF) -> Self {
variant as u8 != 0
}
}
pub type IODEF_R = crate::BitReader<IODEF>;
impl IODEF_R {
#[inline(always)]
pub const fn variant(&self) -> IODEF {
match self.bits {
false => IODEF::PushPull,
true => IODEF::Floating,
}
}
#[inline(always)]
pub fn is_push_pull(&self) -> bool {
*self == IODEF::PushPull
}
#[inline(always)]
pub fn is_floating(&self) -> bool {
*self == IODEF::Floating
}
}
pub type IODEF_W<'a, REG> = crate::BitWriter<'a, REG, IODEF>;
impl<'a, REG> IODEF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn push_pull(self) -> &'a mut crate::W<REG> {
self.variant(IODEF::PushPull)
}
#[inline(always)]
pub fn floating(self) -> &'a mut crate::W<REG> {
self.variant(IODEF::Floating)
}
}
pub type MCV_R = crate::FieldReader;
pub type MCV_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type PGPSC_R = crate::FieldReader;
pub type PGPSC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type SSPSC_R = crate::BitReader;
pub type SSPSC_W<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SSE {
Disabled = 0,
Enabled = 1,
}
impl From<SSE> for bool {
#[inline(always)]
fn from(variant: SSE) -> Self {
variant as u8 != 0
}
}
pub type SSE_R = crate::BitReader<SSE>;
impl SSE_R {
#[inline(always)]
pub const fn variant(&self) -> SSE {
match self.bits {
false => SSE::Disabled,
true => SSE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SSE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SSE::Enabled
}
}
pub type SSE_W<'a, REG> = crate::BitWriter<'a, REG, SSE>;
impl<'a, REG> SSE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SSE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SSE::Enabled)
}
}
pub type SSD_R = crate::FieldReader;
pub type SSD_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
pub type CTPL_R = crate::FieldReader;
pub type CTPL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type CTPH_R = crate::FieldReader;
pub type CTPH_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
impl R {
#[inline(always)]
pub fn tsce(&self) -> TSCE_R {
TSCE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn start(&self) -> START_R {
START_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn am(&self) -> AM_R {
AM_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn syncpol(&self) -> SYNCPOL_R {
SYNCPOL_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn iodef(&self) -> IODEF_R {
IODEF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn mcv(&self) -> MCV_R {
MCV_R::new(((self.bits >> 5) & 7) as u8)
}
#[inline(always)]
pub fn pgpsc(&self) -> PGPSC_R {
PGPSC_R::new(((self.bits >> 12) & 7) as u8)
}
#[inline(always)]
pub fn sspsc(&self) -> SSPSC_R {
SSPSC_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn sse(&self) -> SSE_R {
SSE_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn ssd(&self) -> SSD_R {
SSD_R::new(((self.bits >> 17) & 0x7f) as u8)
}
#[inline(always)]
pub fn ctpl(&self) -> CTPL_R {
CTPL_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn ctph(&self) -> CTPH_R {
CTPH_R::new(((self.bits >> 28) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("ctph", &self.ctph())
.field("ctpl", &self.ctpl())
.field("ssd", &self.ssd())
.field("sse", &self.sse())
.field("sspsc", &self.sspsc())
.field("pgpsc", &self.pgpsc())
.field("mcv", &self.mcv())
.field("iodef", &self.iodef())
.field("syncpol", &self.syncpol())
.field("am", &self.am())
.field("start", &self.start())
.field("tsce", &self.tsce())
.finish()
}
}
impl W {
#[inline(always)]
pub fn tsce(&mut self) -> TSCE_W<CRrs> {
TSCE_W::new(self, 0)
}
#[inline(always)]
pub fn start(&mut self) -> START_W<CRrs> {
START_W::new(self, 1)
}
#[inline(always)]
pub fn am(&mut self) -> AM_W<CRrs> {
AM_W::new(self, 2)
}
#[inline(always)]
pub fn syncpol(&mut self) -> SYNCPOL_W<CRrs> {
SYNCPOL_W::new(self, 3)
}
#[inline(always)]
pub fn iodef(&mut self) -> IODEF_W<CRrs> {
IODEF_W::new(self, 4)
}
#[inline(always)]
pub fn mcv(&mut self) -> MCV_W<CRrs> {
MCV_W::new(self, 5)
}
#[inline(always)]
pub fn pgpsc(&mut self) -> PGPSC_W<CRrs> {
PGPSC_W::new(self, 12)
}
#[inline(always)]
pub fn sspsc(&mut self) -> SSPSC_W<CRrs> {
SSPSC_W::new(self, 15)
}
#[inline(always)]
pub fn sse(&mut self) -> SSE_W<CRrs> {
SSE_W::new(self, 16)
}
#[inline(always)]
pub fn ssd(&mut self) -> SSD_W<CRrs> {
SSD_W::new(self, 17)
}
#[inline(always)]
pub fn ctpl(&mut self) -> CTPL_W<CRrs> {
CTPL_W::new(self, 24)
}
#[inline(always)]
pub fn ctph(&mut self) -> CTPH_W<CRrs> {
CTPH_W::new(self, 28)
}
}
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 {}