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 START {
Start = 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) -> Option<START> {
match self.bits {
true => Some(START::Start),
_ => None,
}
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == START::Start
}
}
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 start(self) -> &'a mut crate::W<REG> {
self.variant(START::Start)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SUSP {
NotSuspended = 0,
Suspended = 1,
}
impl From<SUSP> for bool {
#[inline(always)]
fn from(variant: SUSP) -> Self {
variant as u8 != 0
}
}
pub type SUSP_R = crate::BitReader<SUSP>;
impl SUSP_R {
#[inline(always)]
pub const fn variant(&self) -> SUSP {
match self.bits {
false => SUSP::NotSuspended,
true => SUSP::Suspended,
}
}
#[inline(always)]
pub fn is_not_suspended(&self) -> bool {
*self == SUSP::NotSuspended
}
#[inline(always)]
pub fn is_suspended(&self) -> bool {
*self == SUSP::Suspended
}
}
pub type SUSP_W<'a, REG> = crate::BitWriter<'a, REG, SUSP>;
impl<'a, REG> SUSP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_suspended(self) -> &'a mut crate::W<REG> {
self.variant(SUSP::NotSuspended)
}
#[inline(always)]
pub fn suspended(self) -> &'a mut crate::W<REG> {
self.variant(SUSP::Suspended)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ABORT {
AbortRequest = 1,
}
impl From<ABORT> for bool {
#[inline(always)]
fn from(variant: ABORT) -> Self {
variant as u8 != 0
}
}
pub type ABORT_R = crate::BitReader<ABORT>;
impl ABORT_R {
#[inline(always)]
pub const fn variant(&self) -> Option<ABORT> {
match self.bits {
true => Some(ABORT::AbortRequest),
_ => None,
}
}
#[inline(always)]
pub fn is_abort_request(&self) -> bool {
*self == ABORT::AbortRequest
}
}
pub type ABORT_W<'a, REG> = crate::BitWriter<'a, REG, ABORT>;
impl<'a, REG> ABORT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn abort_request(self) -> &'a mut crate::W<REG> {
self.variant(ABORT::AbortRequest)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TEIE {
Disabled = 0,
Enabled = 1,
}
impl From<TEIE> for bool {
#[inline(always)]
fn from(variant: TEIE) -> Self {
variant as u8 != 0
}
}
pub type TEIE_R = crate::BitReader<TEIE>;
impl TEIE_R {
#[inline(always)]
pub const fn variant(&self) -> TEIE {
match self.bits {
false => TEIE::Disabled,
true => TEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TEIE::Enabled
}
}
pub type TEIE_W<'a, REG> = crate::BitWriter<'a, REG, TEIE>;
impl<'a, REG> TEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TEIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCIE {
Disabled = 0,
Enabled = 1,
}
impl From<TCIE> for bool {
#[inline(always)]
fn from(variant: TCIE) -> Self {
variant as u8 != 0
}
}
pub type TCIE_R = crate::BitReader<TCIE>;
impl TCIE_R {
#[inline(always)]
pub const fn variant(&self) -> TCIE {
match self.bits {
false => TCIE::Disabled,
true => TCIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TCIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TCIE::Enabled
}
}
pub type TCIE_W<'a, REG> = crate::BitWriter<'a, REG, TCIE>;
impl<'a, REG> TCIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TCIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TCIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TWIE {
Disabled = 0,
Enabled = 1,
}
impl From<TWIE> for bool {
#[inline(always)]
fn from(variant: TWIE) -> Self {
variant as u8 != 0
}
}
pub type TWIE_R = crate::BitReader<TWIE>;
impl TWIE_R {
#[inline(always)]
pub const fn variant(&self) -> TWIE {
match self.bits {
false => TWIE::Disabled,
true => TWIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TWIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TWIE::Enabled
}
}
pub type TWIE_W<'a, REG> = crate::BitWriter<'a, REG, TWIE>;
impl<'a, REG> TWIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TWIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TWIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CAEIE {
Disabled = 0,
Enabled = 1,
}
impl From<CAEIE> for bool {
#[inline(always)]
fn from(variant: CAEIE) -> Self {
variant as u8 != 0
}
}
pub type CAEIE_R = crate::BitReader<CAEIE>;
impl CAEIE_R {
#[inline(always)]
pub const fn variant(&self) -> CAEIE {
match self.bits {
false => CAEIE::Disabled,
true => CAEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CAEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CAEIE::Enabled
}
}
pub type CAEIE_W<'a, REG> = crate::BitWriter<'a, REG, CAEIE>;
impl<'a, REG> CAEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CAEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CAEIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CTCIE {
Disabled = 0,
Enabled = 1,
}
impl From<CTCIE> for bool {
#[inline(always)]
fn from(variant: CTCIE) -> Self {
variant as u8 != 0
}
}
pub type CTCIE_R = crate::BitReader<CTCIE>;
impl CTCIE_R {
#[inline(always)]
pub const fn variant(&self) -> CTCIE {
match self.bits {
false => CTCIE::Disabled,
true => CTCIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CTCIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CTCIE::Enabled
}
}
pub type CTCIE_W<'a, REG> = crate::BitWriter<'a, REG, CTCIE>;
impl<'a, REG> CTCIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CTCIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CTCIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CEIE {
Disabled = 0,
Enabled = 1,
}
impl From<CEIE> for bool {
#[inline(always)]
fn from(variant: CEIE) -> Self {
variant as u8 != 0
}
}
pub type CEIE_R = crate::BitReader<CEIE>;
impl CEIE_R {
#[inline(always)]
pub const fn variant(&self) -> CEIE {
match self.bits {
false => CEIE::Disabled,
true => CEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CEIE::Enabled
}
}
pub type CEIE_W<'a, REG> = crate::BitWriter<'a, REG, CEIE>;
impl<'a, REG> CEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CEIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MODE {
MemoryToMemory = 0,
MemoryToMemoryPfc = 1,
MemoryToMemoryPfcblending = 2,
RegisterToMemory = 3,
}
impl From<MODE> for u8 {
#[inline(always)]
fn from(variant: MODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for MODE {
type Ux = u8;
}
impl crate::IsEnum for MODE {}
pub type MODE_R = crate::FieldReader<MODE>;
impl MODE_R {
#[inline(always)]
pub const fn variant(&self) -> MODE {
match self.bits {
0 => MODE::MemoryToMemory,
1 => MODE::MemoryToMemoryPfc,
2 => MODE::MemoryToMemoryPfcblending,
3 => MODE::RegisterToMemory,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_memory_to_memory(&self) -> bool {
*self == MODE::MemoryToMemory
}
#[inline(always)]
pub fn is_memory_to_memory_pfc(&self) -> bool {
*self == MODE::MemoryToMemoryPfc
}
#[inline(always)]
pub fn is_memory_to_memory_pfcblending(&self) -> bool {
*self == MODE::MemoryToMemoryPfcblending
}
#[inline(always)]
pub fn is_register_to_memory(&self) -> bool {
*self == MODE::RegisterToMemory
}
}
pub type MODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, MODE, crate::Safe>;
impl<'a, REG> MODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn memory_to_memory(self) -> &'a mut crate::W<REG> {
self.variant(MODE::MemoryToMemory)
}
#[inline(always)]
pub fn memory_to_memory_pfc(self) -> &'a mut crate::W<REG> {
self.variant(MODE::MemoryToMemoryPfc)
}
#[inline(always)]
pub fn memory_to_memory_pfcblending(self) -> &'a mut crate::W<REG> {
self.variant(MODE::MemoryToMemoryPfcblending)
}
#[inline(always)]
pub fn register_to_memory(self) -> &'a mut crate::W<REG> {
self.variant(MODE::RegisterToMemory)
}
}
impl R {
#[inline(always)]
pub fn start(&self) -> START_R {
START_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn susp(&self) -> SUSP_R {
SUSP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn abort(&self) -> ABORT_R {
ABORT_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn teie(&self) -> TEIE_R {
TEIE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn tcie(&self) -> TCIE_R {
TCIE_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn twie(&self) -> TWIE_R {
TWIE_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn caeie(&self) -> CAEIE_R {
CAEIE_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn ctcie(&self) -> CTCIE_R {
CTCIE_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn ceie(&self) -> CEIE_R {
CEIE_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn mode(&self) -> MODE_R {
MODE_R::new(((self.bits >> 16) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("mode", &self.mode())
.field("ceie", &self.ceie())
.field("ctcie", &self.ctcie())
.field("caeie", &self.caeie())
.field("twie", &self.twie())
.field("tcie", &self.tcie())
.field("teie", &self.teie())
.field("abort", &self.abort())
.field("susp", &self.susp())
.field("start", &self.start())
.finish()
}
}
impl W {
#[inline(always)]
pub fn start(&mut self) -> START_W<CRrs> {
START_W::new(self, 0)
}
#[inline(always)]
pub fn susp(&mut self) -> SUSP_W<CRrs> {
SUSP_W::new(self, 1)
}
#[inline(always)]
pub fn abort(&mut self) -> ABORT_W<CRrs> {
ABORT_W::new(self, 2)
}
#[inline(always)]
pub fn teie(&mut self) -> TEIE_W<CRrs> {
TEIE_W::new(self, 8)
}
#[inline(always)]
pub fn tcie(&mut self) -> TCIE_W<CRrs> {
TCIE_W::new(self, 9)
}
#[inline(always)]
pub fn twie(&mut self) -> TWIE_W<CRrs> {
TWIE_W::new(self, 10)
}
#[inline(always)]
pub fn caeie(&mut self) -> CAEIE_W<CRrs> {
CAEIE_W::new(self, 11)
}
#[inline(always)]
pub fn ctcie(&mut self) -> CTCIE_W<CRrs> {
CTCIE_W::new(self, 12)
}
#[inline(always)]
pub fn ceie(&mut self) -> CEIE_W<CRrs> {
CEIE_W::new(self, 13)
}
#[inline(always)]
pub fn mode(&mut self) -> MODE_W<CRrs> {
MODE_W::new(self, 16)
}
}
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 {}