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 RESETW {
Reset = 1,
}
impl From<RESETW> for bool {
#[inline(always)]
fn from(variant: RESETW) -> Self {
variant as u8 != 0
}
}
pub type RESET_R = crate::BitReader<RESETW>;
impl RESET_R {
#[inline(always)]
pub const fn variant(&self) -> Option<RESETW> {
match self.bits {
true => Some(RESETW::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == RESETW::Reset
}
}
pub type RESET_W<'a, REG> = crate::BitWriter<'a, REG, RESETW>;
impl<'a, REG> RESET_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(RESETW::Reset)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum POLYSIZE {
Polysize32 = 0,
Polysize16 = 1,
Polysize8 = 2,
Polysize7 = 3,
}
impl From<POLYSIZE> for u8 {
#[inline(always)]
fn from(variant: POLYSIZE) -> Self {
variant as _
}
}
impl crate::FieldSpec for POLYSIZE {
type Ux = u8;
}
impl crate::IsEnum for POLYSIZE {}
pub type POLYSIZE_R = crate::FieldReader<POLYSIZE>;
impl POLYSIZE_R {
#[inline(always)]
pub const fn variant(&self) -> POLYSIZE {
match self.bits {
0 => POLYSIZE::Polysize32,
1 => POLYSIZE::Polysize16,
2 => POLYSIZE::Polysize8,
3 => POLYSIZE::Polysize7,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_polysize32(&self) -> bool {
*self == POLYSIZE::Polysize32
}
#[inline(always)]
pub fn is_polysize16(&self) -> bool {
*self == POLYSIZE::Polysize16
}
#[inline(always)]
pub fn is_polysize8(&self) -> bool {
*self == POLYSIZE::Polysize8
}
#[inline(always)]
pub fn is_polysize7(&self) -> bool {
*self == POLYSIZE::Polysize7
}
}
pub type POLYSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, POLYSIZE, crate::Safe>;
impl<'a, REG> POLYSIZE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn polysize32(self) -> &'a mut crate::W<REG> {
self.variant(POLYSIZE::Polysize32)
}
#[inline(always)]
pub fn polysize16(self) -> &'a mut crate::W<REG> {
self.variant(POLYSIZE::Polysize16)
}
#[inline(always)]
pub fn polysize8(self) -> &'a mut crate::W<REG> {
self.variant(POLYSIZE::Polysize8)
}
#[inline(always)]
pub fn polysize7(self) -> &'a mut crate::W<REG> {
self.variant(POLYSIZE::Polysize7)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum REV_IN {
Normal = 0,
Byte = 1,
HalfWord = 2,
Word = 3,
}
impl From<REV_IN> for u8 {
#[inline(always)]
fn from(variant: REV_IN) -> Self {
variant as _
}
}
impl crate::FieldSpec for REV_IN {
type Ux = u8;
}
impl crate::IsEnum for REV_IN {}
pub type REV_IN_R = crate::FieldReader<REV_IN>;
impl REV_IN_R {
#[inline(always)]
pub const fn variant(&self) -> REV_IN {
match self.bits {
0 => REV_IN::Normal,
1 => REV_IN::Byte,
2 => REV_IN::HalfWord,
3 => REV_IN::Word,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_normal(&self) -> bool {
*self == REV_IN::Normal
}
#[inline(always)]
pub fn is_byte(&self) -> bool {
*self == REV_IN::Byte
}
#[inline(always)]
pub fn is_half_word(&self) -> bool {
*self == REV_IN::HalfWord
}
#[inline(always)]
pub fn is_word(&self) -> bool {
*self == REV_IN::Word
}
}
pub type REV_IN_W<'a, REG> = crate::FieldWriter<'a, REG, 2, REV_IN, crate::Safe>;
impl<'a, REG> REV_IN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn normal(self) -> &'a mut crate::W<REG> {
self.variant(REV_IN::Normal)
}
#[inline(always)]
pub fn byte(self) -> &'a mut crate::W<REG> {
self.variant(REV_IN::Byte)
}
#[inline(always)]
pub fn half_word(self) -> &'a mut crate::W<REG> {
self.variant(REV_IN::HalfWord)
}
#[inline(always)]
pub fn word(self) -> &'a mut crate::W<REG> {
self.variant(REV_IN::Word)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum REV_OUT {
Normal = 0,
Reversed = 1,
}
impl From<REV_OUT> for bool {
#[inline(always)]
fn from(variant: REV_OUT) -> Self {
variant as u8 != 0
}
}
pub type REV_OUT_R = crate::BitReader<REV_OUT>;
impl REV_OUT_R {
#[inline(always)]
pub const fn variant(&self) -> REV_OUT {
match self.bits {
false => REV_OUT::Normal,
true => REV_OUT::Reversed,
}
}
#[inline(always)]
pub fn is_normal(&self) -> bool {
*self == REV_OUT::Normal
}
#[inline(always)]
pub fn is_reversed(&self) -> bool {
*self == REV_OUT::Reversed
}
}
pub type REV_OUT_W<'a, REG> = crate::BitWriter<'a, REG, REV_OUT>;
impl<'a, REG> REV_OUT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn normal(self) -> &'a mut crate::W<REG> {
self.variant(REV_OUT::Normal)
}
#[inline(always)]
pub fn reversed(self) -> &'a mut crate::W<REG> {
self.variant(REV_OUT::Reversed)
}
}
impl R {
#[inline(always)]
pub fn reset(&self) -> RESET_R {
RESET_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn polysize(&self) -> POLYSIZE_R {
POLYSIZE_R::new(((self.bits >> 3) & 3) as u8)
}
#[inline(always)]
pub fn rev_in(&self) -> REV_IN_R {
REV_IN_R::new(((self.bits >> 5) & 3) as u8)
}
#[inline(always)]
pub fn rev_out(&self) -> REV_OUT_R {
REV_OUT_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("reset", &self.reset())
.field("polysize", &self.polysize())
.field("rev_in", &self.rev_in())
.field("rev_out", &self.rev_out())
.finish()
}
}
impl W {
#[inline(always)]
pub fn reset(&mut self) -> RESET_W<CRrs> {
RESET_W::new(self, 0)
}
#[inline(always)]
pub fn polysize(&mut self) -> POLYSIZE_W<CRrs> {
POLYSIZE_W::new(self, 3)
}
#[inline(always)]
pub fn rev_in(&mut self) -> REV_IN_W<CRrs> {
REV_IN_W::new(self, 5)
}
#[inline(always)]
pub fn rev_out(&mut self) -> REV_OUT_W<CRrs> {
REV_OUT_W::new(self, 7)
}
}
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;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for CRrs {
const RESET_VALUE: u32 = 0;
}