pub type R = crate::R<SEQCTRLrs>;
pub type W = crate::W<SEQCTRLrs>;
pub type LengthaR = crate::FieldReader<u16>;
pub type LengthaW<'a, REG> = crate::FieldWriter<'a, REG, 14, u16>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum BLOCKSIZE {
_16bytes = 0,
_32bytes = 1,
_64bytes = 2,
}
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::_16bytes),
1 => Some(BLOCKSIZE::_32bytes),
2 => Some(BLOCKSIZE::_64bytes),
_ => None,
}
}
#[inline(always)]
pub fn is_16bytes(&self) -> bool {
*self == BLOCKSIZE::_16bytes
}
#[inline(always)]
pub fn is_32bytes(&self) -> bool {
*self == BLOCKSIZE::_32bytes
}
#[inline(always)]
pub fn is_64bytes(&self) -> bool {
*self == BLOCKSIZE::_64bytes
}
}
pub type BlocksizeW<'a, REG> = crate::FieldWriter<'a, REG, 2, BLOCKSIZE>;
impl<'a, REG> BlocksizeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn _16bytes(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::_16bytes)
}
#[inline(always)]
pub fn _32bytes(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::_32bytes)
}
#[inline(always)]
pub fn _64bytes(self) -> &'a mut crate::W<REG> {
self.variant(BLOCKSIZE::_64bytes)
}
}
pub type Dma0skipR = crate::FieldReader;
pub type Dma0skipW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type Dma1skipR = crate::FieldReader;
pub type Dma1skipW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type Dma0presaR = crate::BitReader;
pub type Dma0presaW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Dma1presaR = crate::BitReader;
pub type Dma1presaW<'a, REG> = crate::BitWriter<'a, REG>;
pub type HaltR = crate::BitReader;
pub type HaltW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn lengtha(&self) -> LengthaR {
LengthaR::new((self.bits & 0x3fff) as u16)
}
#[inline(always)]
pub fn blocksize(&self) -> BlocksizeR {
BlocksizeR::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn dma0skip(&self) -> Dma0skipR {
Dma0skipR::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn dma1skip(&self) -> Dma1skipR {
Dma1skipR::new(((self.bits >> 26) & 3) as u8)
}
#[inline(always)]
pub fn dma0presa(&self) -> Dma0presaR {
Dma0presaR::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn dma1presa(&self) -> Dma1presaR {
Dma1presaR::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn halt(&self) -> HaltR {
HaltR::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("SEQCTRL")
.field("lengtha", &self.lengtha())
.field("blocksize", &self.blocksize())
.field("dma0skip", &self.dma0skip())
.field("dma1skip", &self.dma1skip())
.field("dma0presa", &self.dma0presa())
.field("dma1presa", &self.dma1presa())
.field("halt", &self.halt())
.finish()
}
}
impl W {
#[inline(always)]
pub fn lengtha(&mut self) -> LengthaW<'_, SEQCTRLrs> {
LengthaW::new(self, 0)
}
#[inline(always)]
pub fn blocksize(&mut self) -> BlocksizeW<'_, SEQCTRLrs> {
BlocksizeW::new(self, 20)
}
#[inline(always)]
pub fn dma0skip(&mut self) -> Dma0skipW<'_, SEQCTRLrs> {
Dma0skipW::new(self, 24)
}
#[inline(always)]
pub fn dma1skip(&mut self) -> Dma1skipW<'_, SEQCTRLrs> {
Dma1skipW::new(self, 26)
}
#[inline(always)]
pub fn dma0presa(&mut self) -> Dma0presaW<'_, SEQCTRLrs> {
Dma0presaW::new(self, 28)
}
#[inline(always)]
pub fn dma1presa(&mut self) -> Dma1presaW<'_, SEQCTRLrs> {
Dma1presaW::new(self, 29)
}
#[inline(always)]
pub fn halt(&mut self) -> HaltW<'_, SEQCTRLrs> {
HaltW::new(self, 31)
}
}
pub struct SEQCTRLrs;
impl crate::RegisterSpec for SEQCTRLrs {
type Ux = u32;
}
impl crate::Readable for SEQCTRLrs {}
impl crate::Writable for SEQCTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SEQCTRLrs {}