pub type R = crate::R<CCRrs>;
pub type W = crate::W<CCRrs>;
pub type DMAREQ_ID_R = crate::FieldReader;
pub type DMAREQ_ID_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOIE {
Disabled = 0,
Enabled = 1,
}
impl From<SOIE> for bool {
#[inline(always)]
fn from(variant: SOIE) -> Self {
variant as u8 != 0
}
}
pub type SOIE_R = crate::BitReader<SOIE>;
impl SOIE_R {
#[inline(always)]
pub const fn variant(&self) -> SOIE {
match self.bits {
false => SOIE::Disabled,
true => SOIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SOIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SOIE::Enabled
}
}
pub type SOIE_W<'a, REG> = crate::BitWriter<'a, REG, SOIE>;
impl<'a, REG> SOIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SOIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SOIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EGE {
Disabled = 0,
Enabled = 1,
}
impl From<EGE> for bool {
#[inline(always)]
fn from(variant: EGE) -> Self {
variant as u8 != 0
}
}
pub type EGE_R = crate::BitReader<EGE>;
impl EGE_R {
#[inline(always)]
pub const fn variant(&self) -> EGE {
match self.bits {
false => EGE::Disabled,
true => EGE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EGE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == EGE::Enabled
}
}
pub type EGE_W<'a, REG> = crate::BitWriter<'a, REG, EGE>;
impl<'a, REG> EGE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(EGE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(EGE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SE {
Disabled = 0,
Enabled = 1,
}
impl From<SE> for bool {
#[inline(always)]
fn from(variant: SE) -> Self {
variant as u8 != 0
}
}
pub type SE_R = crate::BitReader<SE>;
impl SE_R {
#[inline(always)]
pub const fn variant(&self) -> SE {
match self.bits {
false => SE::Disabled,
true => SE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SE::Enabled
}
}
pub type SE_W<'a, REG> = crate::BitWriter<'a, REG, SE>;
impl<'a, REG> SE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SPOL {
NoEdge = 0,
RisingEdge = 1,
FallingEdge = 2,
BothEdges = 3,
}
impl From<SPOL> for u8 {
#[inline(always)]
fn from(variant: SPOL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SPOL {
type Ux = u8;
}
impl crate::IsEnum for SPOL {}
pub type SPOL_R = crate::FieldReader<SPOL>;
impl SPOL_R {
#[inline(always)]
pub const fn variant(&self) -> SPOL {
match self.bits {
0 => SPOL::NoEdge,
1 => SPOL::RisingEdge,
2 => SPOL::FallingEdge,
3 => SPOL::BothEdges,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_edge(&self) -> bool {
*self == SPOL::NoEdge
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == SPOL::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == SPOL::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == SPOL::BothEdges
}
}
pub type SPOL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SPOL, crate::Safe>;
impl<'a, REG> SPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_edge(self) -> &'a mut crate::W<REG> {
self.variant(SPOL::NoEdge)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(SPOL::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(SPOL::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(SPOL::BothEdges)
}
}
pub type NBREQ_R = crate::FieldReader;
pub type NBREQ_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
pub type SYNC_ID_R = crate::FieldReader;
pub type SYNC_ID_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
impl R {
#[inline(always)]
pub fn dmareq_id(&self) -> DMAREQ_ID_R {
DMAREQ_ID_R::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn soie(&self) -> SOIE_R {
SOIE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ege(&self) -> EGE_R {
EGE_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn se(&self) -> SE_R {
SE_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn spol(&self) -> SPOL_R {
SPOL_R::new(((self.bits >> 17) & 3) as u8)
}
#[inline(always)]
pub fn nbreq(&self) -> NBREQ_R {
NBREQ_R::new(((self.bits >> 19) & 0x1f) as u8)
}
#[inline(always)]
pub fn sync_id(&self) -> SYNC_ID_R {
SYNC_ID_R::new(((self.bits >> 24) & 0x1f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCR")
.field("dmareq_id", &self.dmareq_id())
.field("soie", &self.soie())
.field("ege", &self.ege())
.field("se", &self.se())
.field("spol", &self.spol())
.field("nbreq", &self.nbreq())
.field("sync_id", &self.sync_id())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dmareq_id(&mut self) -> DMAREQ_ID_W<CCRrs> {
DMAREQ_ID_W::new(self, 0)
}
#[inline(always)]
pub fn soie(&mut self) -> SOIE_W<CCRrs> {
SOIE_W::new(self, 8)
}
#[inline(always)]
pub fn ege(&mut self) -> EGE_W<CCRrs> {
EGE_W::new(self, 9)
}
#[inline(always)]
pub fn se(&mut self) -> SE_W<CCRrs> {
SE_W::new(self, 16)
}
#[inline(always)]
pub fn spol(&mut self) -> SPOL_W<CCRrs> {
SPOL_W::new(self, 17)
}
#[inline(always)]
pub fn nbreq(&mut self) -> NBREQ_W<CCRrs> {
NBREQ_W::new(self, 19)
}
#[inline(always)]
pub fn sync_id(&mut self) -> SYNC_ID_W<CCRrs> {
SYNC_ID_W::new(self, 24)
}
}
pub struct CCRrs;
impl crate::RegisterSpec for CCRrs {
type Ux = u32;
}
impl crate::Readable for CCRrs {}
impl crate::Writable for CCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCRrs {}