pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum STRUCTTYPE {
Transfer = 0,
Synchronize = 1,
Write = 2,
}
impl From<STRUCTTYPE> for u8 {
#[inline(always)]
fn from(variant: STRUCTTYPE) -> Self {
variant as _
}
}
impl crate::FieldSpec for STRUCTTYPE {
type Ux = u8;
}
impl crate::IsEnum for STRUCTTYPE {}
pub type StructtypeR = crate::FieldReader<STRUCTTYPE>;
impl StructtypeR {
#[inline(always)]
pub const fn variant(&self) -> Option<STRUCTTYPE> {
match self.bits {
0 => Some(STRUCTTYPE::Transfer),
1 => Some(STRUCTTYPE::Synchronize),
2 => Some(STRUCTTYPE::Write),
_ => None,
}
}
#[inline(always)]
pub fn is_transfer(&self) -> bool {
*self == STRUCTTYPE::Transfer
}
#[inline(always)]
pub fn is_synchronize(&self) -> bool {
*self == STRUCTTYPE::Synchronize
}
#[inline(always)]
pub fn is_write(&self) -> bool {
*self == STRUCTTYPE::Write
}
}
pub type StructreqW<'a, REG> = crate::BitWriter<'a, REG>;
pub type XfercntR = crate::FieldReader<u16>;
pub type XfercntW<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
pub type ByteswapR = crate::BitReader;
pub type ByteswapW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum BLOCKSIZE {
Unit1 = 0,
Unit2 = 1,
Unit3 = 2,
Unit4 = 3,
Unit6 = 4,
Unit8 = 5,
Unit16 = 7,
Unit32 = 9,
Unit64 = 10,
Unit128 = 11,
Unit256 = 12,
Unit512 = 13,
Unit1024 = 14,
All = 15,
}
impl From<BLOCKSIZE> for u8 {
#[inline(always)]
fn from(variant: BLOCKSIZE) -> Self {
variant as _
}
}
impl crate::FieldSpec for BLOCKSIZE {
type Ux = u8;
}
impl crate::IsEnum for BLOCKSIZE {}
pub type BlocksizeR = crate::FieldReader<BLOCKSIZE>;
impl BlocksizeR {
#[inline(always)]
pub const fn variant(&self) -> Option<BLOCKSIZE> {
match self.bits {
0 => Some(BLOCKSIZE::Unit1),
1 => Some(BLOCKSIZE::Unit2),
2 => Some(BLOCKSIZE::Unit3),
3 => Some(BLOCKSIZE::Unit4),
4 => Some(BLOCKSIZE::Unit6),
5 => Some(BLOCKSIZE::Unit8),
7 => Some(BLOCKSIZE::Unit16),
9 => Some(BLOCKSIZE::Unit32),
10 => Some(BLOCKSIZE::Unit64),
11 => Some(BLOCKSIZE::Unit128),
12 => Some(BLOCKSIZE::Unit256),
13 => Some(BLOCKSIZE::Unit512),
14 => Some(BLOCKSIZE::Unit1024),
15 => Some(BLOCKSIZE::All),
_ => None,
}
}
#[inline(always)]
pub fn is_unit1(&self) -> bool {
*self == BLOCKSIZE::Unit1
}
#[inline(always)]
pub fn is_unit2(&self) -> bool {
*self == BLOCKSIZE::Unit2
}
#[inline(always)]
pub fn is_unit3(&self) -> bool {
*self == BLOCKSIZE::Unit3
}
#[inline(always)]
pub fn is_unit4(&self) -> bool {
*self == BLOCKSIZE::Unit4
}
#[inline(always)]
pub fn is_unit6(&self) -> bool {
*self == BLOCKSIZE::Unit6
}
#[inline(always)]
pub fn is_unit8(&self) -> bool {
*self == BLOCKSIZE::Unit8
}
#[inline(always)]
pub fn is_unit16(&self) -> bool {
*self == BLOCKSIZE::Unit16
}
#[inline(always)]
pub fn is_unit32(&self) -> bool {
*self == BLOCKSIZE::Unit32
}
#[inline(always)]
pub fn is_unit64(&self) -> bool {
*self == BLOCKSIZE::Unit64
}
#[inline(always)]
pub fn is_unit128(&self) -> bool {
*self == BLOCKSIZE::Unit128
}
#[inline(always)]
pub fn is_unit256(&self) -> bool {
*self == BLOCKSIZE::Unit256
}
#[inline(always)]
pub fn is_unit512(&self) -> bool {
*self == BLOCKSIZE::Unit512
}
#[inline(always)]
pub fn is_unit1024(&self) -> bool {
*self == BLOCKSIZE::Unit1024
}
#[inline(always)]
pub fn is_all(&self) -> bool {
*self == BLOCKSIZE::All
}
}
pub type BlocksizeW<'a, REG> = crate::FieldWriter<'a, REG, 4, BLOCKSIZE>;
impl<'a, REG> BlocksizeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn unit1(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit1)
}
#[inline(always)]
pub fn unit2(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit2)
}
#[inline(always)]
pub fn unit3(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit3)
}
#[inline(always)]
pub fn unit4(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit4)
}
#[inline(always)]
pub fn unit6(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit6)
}
#[inline(always)]
pub fn unit8(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit8)
}
#[inline(always)]
pub fn unit16(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit16)
}
#[inline(always)]
pub fn unit32(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit32)
}
#[inline(always)]
pub fn unit64(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit64)
}
#[inline(always)]
pub fn unit128(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit128)
}
#[inline(always)]
pub fn unit256(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit256)
}
#[inline(always)]
pub fn unit512(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit512)
}
#[inline(always)]
pub fn unit1024(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::Unit1024)
}
#[inline(always)]
pub fn all(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::All)
}
}
pub type DoneifsenR = crate::BitReader;
pub type DoneifsenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ReqmodeR = crate::BitReader;
pub type ReqmodeW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DecloopcntR = crate::BitReader;
pub type DecloopcntW<'a, REG> = crate::BitWriter<'a, REG>;
pub type IgnoresreqR = crate::BitReader;
pub type IgnoresreqW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SRCINC {
One = 0,
Two = 1,
Four = 2,
None = 3,
}
impl From<SRCINC> for u8 {
#[inline(always)]
fn from(variant: SRCINC) -> Self {
variant as _
}
}
impl crate::FieldSpec for SRCINC {
type Ux = u8;
}
impl crate::IsEnum for SRCINC {}
pub type SrcincR = crate::FieldReader<SRCINC>;
impl SrcincR {
#[inline(always)]
pub const fn variant(&self) -> SRCINC {
match self.bits {
0 => SRCINC::One,
1 => SRCINC::Two,
2 => SRCINC::Four,
3 => SRCINC::None,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == SRCINC::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == SRCINC::Two
}
#[inline(always)]
pub fn is_four(&self) -> bool {
*self == SRCINC::Four
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == SRCINC::None
}
}
pub type SrcincW<'a, REG> = crate::FieldWriter<'a, REG, 2, SRCINC, crate::Safe>;
impl<'a, REG> SrcincW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(SRCINC::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(SRCINC::Two)
}
#[inline(always)]
pub fn four(self) -> &'a mut crate::W<REG> {
self.variant(SRCINC::Four)
}
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(SRCINC::None)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SIZE {
Byte = 0,
Halfword = 1,
Word = 2,
}
impl From<SIZE> for u8 {
#[inline(always)]
fn from(variant: SIZE) -> Self {
variant as _
}
}
impl crate::FieldSpec for SIZE {
type Ux = u8;
}
impl crate::IsEnum for SIZE {}
pub type SizeR = crate::FieldReader<SIZE>;
impl SizeR {
#[inline(always)]
pub const fn variant(&self) -> Option<SIZE> {
match self.bits {
0 => Some(SIZE::Byte),
1 => Some(SIZE::Halfword),
2 => Some(SIZE::Word),
_ => None,
}
}
#[inline(always)]
pub fn is_byte(&self) -> bool {
*self == SIZE::Byte
}
#[inline(always)]
pub fn is_halfword(&self) -> bool {
*self == SIZE::Halfword
}
#[inline(always)]
pub fn is_word(&self) -> bool {
*self == SIZE::Word
}
}
pub type SizeW<'a, REG> = crate::FieldWriter<'a, REG, 2, SIZE>;
impl<'a, REG> SizeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn byte(self) -> &'a mut crate::W<REG> {
self.variant(SIZE::Byte)
}
#[inline(always)]
pub fn halfword(self) -> &'a mut crate::W<REG> {
self.variant(SIZE::Halfword)
}
#[inline(always)]
pub fn word(self) -> &'a mut crate::W<REG> {
self.variant(SIZE::Word)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DSTINC {
One = 0,
Two = 1,
Four = 2,
None = 3,
}
impl From<DSTINC> for u8 {
#[inline(always)]
fn from(variant: DSTINC) -> Self {
variant as _
}
}
impl crate::FieldSpec for DSTINC {
type Ux = u8;
}
impl crate::IsEnum for DSTINC {}
pub type DstincR = crate::FieldReader<DSTINC>;
impl DstincR {
#[inline(always)]
pub const fn variant(&self) -> DSTINC {
match self.bits {
0 => DSTINC::One,
1 => DSTINC::Two,
2 => DSTINC::Four,
3 => DSTINC::None,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == DSTINC::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == DSTINC::Two
}
#[inline(always)]
pub fn is_four(&self) -> bool {
*self == DSTINC::Four
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == DSTINC::None
}
}
pub type DstincW<'a, REG> = crate::FieldWriter<'a, REG, 2, DSTINC, crate::Safe>;
impl<'a, REG> DstincW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(DSTINC::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(DSTINC::Two)
}
#[inline(always)]
pub fn four(self) -> &'a mut crate::W<REG> {
self.variant(DSTINC::Four)
}
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(DSTINC::None)
}
}
pub type SrcmodeR = crate::BitReader;
pub type DstmodeR = crate::BitReader;
impl R {
#[inline(always)]
pub fn structtype(&self) -> StructtypeR {
StructtypeR::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn xfercnt(&self) -> XfercntR {
XfercntR::new(((self.bits >> 4) & 0x07ff) as u16)
}
#[inline(always)]
pub fn byteswap(&self) -> ByteswapR {
ByteswapR::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn blocksize(&self) -> BlocksizeR {
BlocksizeR::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn doneifsen(&self) -> DoneifsenR {
DoneifsenR::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn reqmode(&self) -> ReqmodeR {
ReqmodeR::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn decloopcnt(&self) -> DecloopcntR {
DecloopcntR::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn ignoresreq(&self) -> IgnoresreqR {
IgnoresreqR::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn srcinc(&self) -> SrcincR {
SrcincR::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn size(&self) -> SizeR {
SizeR::new(((self.bits >> 26) & 3) as u8)
}
#[inline(always)]
pub fn dstinc(&self) -> DstincR {
DstincR::new(((self.bits >> 28) & 3) as u8)
}
#[inline(always)]
pub fn srcmode(&self) -> SrcmodeR {
SrcmodeR::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn dstmode(&self) -> DstmodeR {
DstmodeR::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("structtype", &self.structtype())
.field("xfercnt", &self.xfercnt())
.field("byteswap", &self.byteswap())
.field("blocksize", &self.blocksize())
.field("doneifsen", &self.doneifsen())
.field("reqmode", &self.reqmode())
.field("decloopcnt", &self.decloopcnt())
.field("ignoresreq", &self.ignoresreq())
.field("srcinc", &self.srcinc())
.field("size", &self.size())
.field("dstinc", &self.dstinc())
.field("srcmode", &self.srcmode())
.field("dstmode", &self.dstmode())
.finish()
}
}
impl W {
#[inline(always)]
pub fn structreq(&mut self) -> StructreqW<'_, CTRLrs> {
StructreqW::new(self, 3)
}
#[inline(always)]
pub fn xfercnt(&mut self) -> XfercntW<'_, CTRLrs> {
XfercntW::new(self, 4)
}
#[inline(always)]
pub fn byteswap(&mut self) -> ByteswapW<'_, CTRLrs> {
ByteswapW::new(self, 15)
}
#[inline(always)]
pub fn blocksize(&mut self) -> BlocksizeW<'_, CTRLrs> {
BlocksizeW::new(self, 16)
}
#[inline(always)]
pub fn doneifsen(&mut self) -> DoneifsenW<'_, CTRLrs> {
DoneifsenW::new(self, 20)
}
#[inline(always)]
pub fn reqmode(&mut self) -> ReqmodeW<'_, CTRLrs> {
ReqmodeW::new(self, 21)
}
#[inline(always)]
pub fn decloopcnt(&mut self) -> DecloopcntW<'_, CTRLrs> {
DecloopcntW::new(self, 22)
}
#[inline(always)]
pub fn ignoresreq(&mut self) -> IgnoresreqW<'_, CTRLrs> {
IgnoresreqW::new(self, 23)
}
#[inline(always)]
pub fn srcinc(&mut self) -> SrcincW<'_, CTRLrs> {
SrcincW::new(self, 24)
}
#[inline(always)]
pub fn size(&mut self) -> SizeW<'_, CTRLrs> {
SizeW::new(self, 26)
}
#[inline(always)]
pub fn dstinc(&mut self) -> DstincW<'_, CTRLrs> {
DstincW::new(self, 28)
}
}
pub struct CTRLrs;
impl crate::RegisterSpec for CTRLrs {
type Ux = u32;
}
impl crate::Readable for CTRLrs {}
impl crate::Writable for CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CTRLrs {}