pub type R = crate::R<CR2rs>;
pub type W = crate::W<CR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADDM7 {
Bit4 = 0,
Bit7 = 1,
}
impl From<ADDM7> for bool {
#[inline(always)]
fn from(variant: ADDM7) -> Self {
variant as u8 != 0
}
}
pub type ADDM7_R = crate::BitReader<ADDM7>;
impl ADDM7_R {
#[inline(always)]
pub const fn variant(&self) -> ADDM7 {
match self.bits {
false => ADDM7::Bit4,
true => ADDM7::Bit7,
}
}
#[inline(always)]
pub fn is_bit4(&self) -> bool {
*self == ADDM7::Bit4
}
#[inline(always)]
pub fn is_bit7(&self) -> bool {
*self == ADDM7::Bit7
}
}
pub type ADDM7_W<'a, REG> = crate::BitWriter<'a, REG, ADDM7>;
impl<'a, REG> ADDM7_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn bit4(self) -> &'a mut crate::W<REG> {
self.variant(ADDM7::Bit4)
}
#[inline(always)]
pub fn bit7(self) -> &'a mut crate::W<REG> {
self.variant(ADDM7::Bit7)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LBDL {
Bit10 = 0,
Bit11 = 1,
}
impl From<LBDL> for bool {
#[inline(always)]
fn from(variant: LBDL) -> Self {
variant as u8 != 0
}
}
pub type LBDL_R = crate::BitReader<LBDL>;
impl LBDL_R {
#[inline(always)]
pub const fn variant(&self) -> LBDL {
match self.bits {
false => LBDL::Bit10,
true => LBDL::Bit11,
}
}
#[inline(always)]
pub fn is_bit10(&self) -> bool {
*self == LBDL::Bit10
}
#[inline(always)]
pub fn is_bit11(&self) -> bool {
*self == LBDL::Bit11
}
}
pub type LBDL_W<'a, REG> = crate::BitWriter<'a, REG, LBDL>;
impl<'a, REG> LBDL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn bit10(self) -> &'a mut crate::W<REG> {
self.variant(LBDL::Bit10)
}
#[inline(always)]
pub fn bit11(self) -> &'a mut crate::W<REG> {
self.variant(LBDL::Bit11)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LBDIE {
Disabled = 0,
Enabled = 1,
}
impl From<LBDIE> for bool {
#[inline(always)]
fn from(variant: LBDIE) -> Self {
variant as u8 != 0
}
}
pub type LBDIE_R = crate::BitReader<LBDIE>;
impl LBDIE_R {
#[inline(always)]
pub const fn variant(&self) -> LBDIE {
match self.bits {
false => LBDIE::Disabled,
true => LBDIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LBDIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == LBDIE::Enabled
}
}
pub type LBDIE_W<'a, REG> = crate::BitWriter<'a, REG, LBDIE>;
impl<'a, REG> LBDIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LBDIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(LBDIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LBCL {
NotOutput = 0,
Output = 1,
}
impl From<LBCL> for bool {
#[inline(always)]
fn from(variant: LBCL) -> Self {
variant as u8 != 0
}
}
pub type LBCL_R = crate::BitReader<LBCL>;
impl LBCL_R {
#[inline(always)]
pub const fn variant(&self) -> LBCL {
match self.bits {
false => LBCL::NotOutput,
true => LBCL::Output,
}
}
#[inline(always)]
pub fn is_not_output(&self) -> bool {
*self == LBCL::NotOutput
}
#[inline(always)]
pub fn is_output(&self) -> bool {
*self == LBCL::Output
}
}
pub type LBCL_W<'a, REG> = crate::BitWriter<'a, REG, LBCL>;
impl<'a, REG> LBCL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_output(self) -> &'a mut crate::W<REG> {
self.variant(LBCL::NotOutput)
}
#[inline(always)]
pub fn output(self) -> &'a mut crate::W<REG> {
self.variant(LBCL::Output)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CPHA {
First = 0,
Second = 1,
}
impl From<CPHA> for bool {
#[inline(always)]
fn from(variant: CPHA) -> Self {
variant as u8 != 0
}
}
pub type CPHA_R = crate::BitReader<CPHA>;
impl CPHA_R {
#[inline(always)]
pub const fn variant(&self) -> CPHA {
match self.bits {
false => CPHA::First,
true => CPHA::Second,
}
}
#[inline(always)]
pub fn is_first(&self) -> bool {
*self == CPHA::First
}
#[inline(always)]
pub fn is_second(&self) -> bool {
*self == CPHA::Second
}
}
pub type CPHA_W<'a, REG> = crate::BitWriter<'a, REG, CPHA>;
impl<'a, REG> CPHA_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn first(self) -> &'a mut crate::W<REG> {
self.variant(CPHA::First)
}
#[inline(always)]
pub fn second(self) -> &'a mut crate::W<REG> {
self.variant(CPHA::Second)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CPOL {
Low = 0,
High = 1,
}
impl From<CPOL> for bool {
#[inline(always)]
fn from(variant: CPOL) -> Self {
variant as u8 != 0
}
}
pub type CPOL_R = crate::BitReader<CPOL>;
impl CPOL_R {
#[inline(always)]
pub const fn variant(&self) -> CPOL {
match self.bits {
false => CPOL::Low,
true => CPOL::High,
}
}
#[inline(always)]
pub fn is_low(&self) -> bool {
*self == CPOL::Low
}
#[inline(always)]
pub fn is_high(&self) -> bool {
*self == CPOL::High
}
}
pub type CPOL_W<'a, REG> = crate::BitWriter<'a, REG, CPOL>;
impl<'a, REG> CPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn low(self) -> &'a mut crate::W<REG> {
self.variant(CPOL::Low)
}
#[inline(always)]
pub fn high(self) -> &'a mut crate::W<REG> {
self.variant(CPOL::High)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CLKEN {
Disabled = 0,
Enabled = 1,
}
impl From<CLKEN> for bool {
#[inline(always)]
fn from(variant: CLKEN) -> Self {
variant as u8 != 0
}
}
pub type CLKEN_R = crate::BitReader<CLKEN>;
impl CLKEN_R {
#[inline(always)]
pub const fn variant(&self) -> CLKEN {
match self.bits {
false => CLKEN::Disabled,
true => CLKEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CLKEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CLKEN::Enabled
}
}
pub type CLKEN_W<'a, REG> = crate::BitWriter<'a, REG, CLKEN>;
impl<'a, REG> CLKEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CLKEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CLKEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum STOP {
Stop1 = 0,
Stop0p5 = 1,
Stop2 = 2,
Stop1p5 = 3,
}
impl From<STOP> for u8 {
#[inline(always)]
fn from(variant: STOP) -> Self {
variant as _
}
}
impl crate::FieldSpec for STOP {
type Ux = u8;
}
impl crate::IsEnum for STOP {}
pub type STOP_R = crate::FieldReader<STOP>;
impl STOP_R {
#[inline(always)]
pub const fn variant(&self) -> STOP {
match self.bits {
0 => STOP::Stop1,
1 => STOP::Stop0p5,
2 => STOP::Stop2,
3 => STOP::Stop1p5,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_stop1(&self) -> bool {
*self == STOP::Stop1
}
#[inline(always)]
pub fn is_stop0p5(&self) -> bool {
*self == STOP::Stop0p5
}
#[inline(always)]
pub fn is_stop2(&self) -> bool {
*self == STOP::Stop2
}
#[inline(always)]
pub fn is_stop1p5(&self) -> bool {
*self == STOP::Stop1p5
}
}
pub type STOP_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STOP, crate::Safe>;
impl<'a, REG> STOP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn stop1(self) -> &'a mut crate::W<REG> {
self.variant(STOP::Stop1)
}
#[inline(always)]
pub fn stop0p5(self) -> &'a mut crate::W<REG> {
self.variant(STOP::Stop0p5)
}
#[inline(always)]
pub fn stop2(self) -> &'a mut crate::W<REG> {
self.variant(STOP::Stop2)
}
#[inline(always)]
pub fn stop1p5(self) -> &'a mut crate::W<REG> {
self.variant(STOP::Stop1p5)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LINEN {
Disabled = 0,
Enabled = 1,
}
impl From<LINEN> for bool {
#[inline(always)]
fn from(variant: LINEN) -> Self {
variant as u8 != 0
}
}
pub type LINEN_R = crate::BitReader<LINEN>;
impl LINEN_R {
#[inline(always)]
pub const fn variant(&self) -> LINEN {
match self.bits {
false => LINEN::Disabled,
true => LINEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LINEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == LINEN::Enabled
}
}
pub type LINEN_W<'a, REG> = crate::BitWriter<'a, REG, LINEN>;
impl<'a, REG> LINEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LINEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(LINEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SWAP {
Standard = 0,
Swapped = 1,
}
impl From<SWAP> for bool {
#[inline(always)]
fn from(variant: SWAP) -> Self {
variant as u8 != 0
}
}
pub type SWAP_R = crate::BitReader<SWAP>;
impl SWAP_R {
#[inline(always)]
pub const fn variant(&self) -> SWAP {
match self.bits {
false => SWAP::Standard,
true => SWAP::Swapped,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == SWAP::Standard
}
#[inline(always)]
pub fn is_swapped(&self) -> bool {
*self == SWAP::Swapped
}
}
pub type SWAP_W<'a, REG> = crate::BitWriter<'a, REG, SWAP>;
impl<'a, REG> SWAP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(SWAP::Standard)
}
#[inline(always)]
pub fn swapped(self) -> &'a mut crate::W<REG> {
self.variant(SWAP::Swapped)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXINV {
Standard = 0,
Inverted = 1,
}
impl From<RXINV> for bool {
#[inline(always)]
fn from(variant: RXINV) -> Self {
variant as u8 != 0
}
}
pub type RXINV_R = crate::BitReader<RXINV>;
impl RXINV_R {
#[inline(always)]
pub const fn variant(&self) -> RXINV {
match self.bits {
false => RXINV::Standard,
true => RXINV::Inverted,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == RXINV::Standard
}
#[inline(always)]
pub fn is_inverted(&self) -> bool {
*self == RXINV::Inverted
}
}
pub type RXINV_W<'a, REG> = crate::BitWriter<'a, REG, RXINV>;
impl<'a, REG> RXINV_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(RXINV::Standard)
}
#[inline(always)]
pub fn inverted(self) -> &'a mut crate::W<REG> {
self.variant(RXINV::Inverted)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXINV {
Standard = 0,
Inverted = 1,
}
impl From<TXINV> for bool {
#[inline(always)]
fn from(variant: TXINV) -> Self {
variant as u8 != 0
}
}
pub type TXINV_R = crate::BitReader<TXINV>;
impl TXINV_R {
#[inline(always)]
pub const fn variant(&self) -> TXINV {
match self.bits {
false => TXINV::Standard,
true => TXINV::Inverted,
}
}
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == TXINV::Standard
}
#[inline(always)]
pub fn is_inverted(&self) -> bool {
*self == TXINV::Inverted
}
}
pub type TXINV_W<'a, REG> = crate::BitWriter<'a, REG, TXINV>;
impl<'a, REG> TXINV_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn standard(self) -> &'a mut crate::W<REG> {
self.variant(TXINV::Standard)
}
#[inline(always)]
pub fn inverted(self) -> &'a mut crate::W<REG> {
self.variant(TXINV::Inverted)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DATAINV {
Positive = 0,
Negative = 1,
}
impl From<DATAINV> for bool {
#[inline(always)]
fn from(variant: DATAINV) -> Self {
variant as u8 != 0
}
}
pub type DATAINV_R = crate::BitReader<DATAINV>;
impl DATAINV_R {
#[inline(always)]
pub const fn variant(&self) -> DATAINV {
match self.bits {
false => DATAINV::Positive,
true => DATAINV::Negative,
}
}
#[inline(always)]
pub fn is_positive(&self) -> bool {
*self == DATAINV::Positive
}
#[inline(always)]
pub fn is_negative(&self) -> bool {
*self == DATAINV::Negative
}
}
pub type DATAINV_W<'a, REG> = crate::BitWriter<'a, REG, DATAINV>;
impl<'a, REG> DATAINV_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn positive(self) -> &'a mut crate::W<REG> {
self.variant(DATAINV::Positive)
}
#[inline(always)]
pub fn negative(self) -> &'a mut crate::W<REG> {
self.variant(DATAINV::Negative)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MSBFIRST {
Lsb = 0,
Msb = 1,
}
impl From<MSBFIRST> for bool {
#[inline(always)]
fn from(variant: MSBFIRST) -> Self {
variant as u8 != 0
}
}
pub type MSBFIRST_R = crate::BitReader<MSBFIRST>;
impl MSBFIRST_R {
#[inline(always)]
pub const fn variant(&self) -> MSBFIRST {
match self.bits {
false => MSBFIRST::Lsb,
true => MSBFIRST::Msb,
}
}
#[inline(always)]
pub fn is_lsb(&self) -> bool {
*self == MSBFIRST::Lsb
}
#[inline(always)]
pub fn is_msb(&self) -> bool {
*self == MSBFIRST::Msb
}
}
pub type MSBFIRST_W<'a, REG> = crate::BitWriter<'a, REG, MSBFIRST>;
impl<'a, REG> MSBFIRST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn lsb(self) -> &'a mut crate::W<REG> {
self.variant(MSBFIRST::Lsb)
}
#[inline(always)]
pub fn msb(self) -> &'a mut crate::W<REG> {
self.variant(MSBFIRST::Msb)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ABREN {
Disabled = 0,
Enabled = 1,
}
impl From<ABREN> for bool {
#[inline(always)]
fn from(variant: ABREN) -> Self {
variant as u8 != 0
}
}
pub type ABREN_R = crate::BitReader<ABREN>;
impl ABREN_R {
#[inline(always)]
pub const fn variant(&self) -> ABREN {
match self.bits {
false => ABREN::Disabled,
true => ABREN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ABREN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ABREN::Enabled
}
}
pub type ABREN_W<'a, REG> = crate::BitWriter<'a, REG, ABREN>;
impl<'a, REG> ABREN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ABREN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ABREN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ABRMOD {
Start = 0,
Edge = 1,
Frame7f = 2,
Frame55 = 3,
}
impl From<ABRMOD> for u8 {
#[inline(always)]
fn from(variant: ABRMOD) -> Self {
variant as _
}
}
impl crate::FieldSpec for ABRMOD {
type Ux = u8;
}
impl crate::IsEnum for ABRMOD {}
pub type ABRMOD_R = crate::FieldReader<ABRMOD>;
impl ABRMOD_R {
#[inline(always)]
pub const fn variant(&self) -> ABRMOD {
match self.bits {
0 => ABRMOD::Start,
1 => ABRMOD::Edge,
2 => ABRMOD::Frame7f,
3 => ABRMOD::Frame55,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == ABRMOD::Start
}
#[inline(always)]
pub fn is_edge(&self) -> bool {
*self == ABRMOD::Edge
}
#[inline(always)]
pub fn is_frame7f(&self) -> bool {
*self == ABRMOD::Frame7f
}
#[inline(always)]
pub fn is_frame55(&self) -> bool {
*self == ABRMOD::Frame55
}
}
pub type ABRMOD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ABRMOD, crate::Safe>;
impl<'a, REG> ABRMOD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn start(self) -> &'a mut crate::W<REG> {
self.variant(ABRMOD::Start)
}
#[inline(always)]
pub fn edge(self) -> &'a mut crate::W<REG> {
self.variant(ABRMOD::Edge)
}
#[inline(always)]
pub fn frame7f(self) -> &'a mut crate::W<REG> {
self.variant(ABRMOD::Frame7f)
}
#[inline(always)]
pub fn frame55(self) -> &'a mut crate::W<REG> {
self.variant(ABRMOD::Frame55)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RTOEN {
Disabled = 0,
Enabled = 1,
}
impl From<RTOEN> for bool {
#[inline(always)]
fn from(variant: RTOEN) -> Self {
variant as u8 != 0
}
}
pub type RTOEN_R = crate::BitReader<RTOEN>;
impl RTOEN_R {
#[inline(always)]
pub const fn variant(&self) -> RTOEN {
match self.bits {
false => RTOEN::Disabled,
true => RTOEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RTOEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RTOEN::Enabled
}
}
pub type RTOEN_W<'a, REG> = crate::BitWriter<'a, REG, RTOEN>;
impl<'a, REG> RTOEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RTOEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RTOEN::Enabled)
}
}
pub type ADD_R = crate::FieldReader;
pub type ADD_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
impl R {
#[inline(always)]
pub fn addm7(&self) -> ADDM7_R {
ADDM7_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn lbdl(&self) -> LBDL_R {
LBDL_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn lbdie(&self) -> LBDIE_R {
LBDIE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn lbcl(&self) -> LBCL_R {
LBCL_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn cpha(&self) -> CPHA_R {
CPHA_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn cpol(&self) -> CPOL_R {
CPOL_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn clken(&self) -> CLKEN_R {
CLKEN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn stop(&self) -> STOP_R {
STOP_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn linen(&self) -> LINEN_R {
LINEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn swap(&self) -> SWAP_R {
SWAP_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn rxinv(&self) -> RXINV_R {
RXINV_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn txinv(&self) -> TXINV_R {
TXINV_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn datainv(&self) -> DATAINV_R {
DATAINV_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn msbfirst(&self) -> MSBFIRST_R {
MSBFIRST_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn abren(&self) -> ABREN_R {
ABREN_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn abrmod(&self) -> ABRMOD_R {
ABRMOD_R::new(((self.bits >> 21) & 3) as u8)
}
#[inline(always)]
pub fn rtoen(&self) -> RTOEN_R {
RTOEN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn add(&self) -> ADD_R {
ADD_R::new(((self.bits >> 24) & 0xff) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR2")
.field("add", &self.add())
.field("rtoen", &self.rtoen())
.field("abrmod", &self.abrmod())
.field("abren", &self.abren())
.field("msbfirst", &self.msbfirst())
.field("datainv", &self.datainv())
.field("txinv", &self.txinv())
.field("rxinv", &self.rxinv())
.field("swap", &self.swap())
.field("linen", &self.linen())
.field("stop", &self.stop())
.field("clken", &self.clken())
.field("cpol", &self.cpol())
.field("cpha", &self.cpha())
.field("lbcl", &self.lbcl())
.field("lbdie", &self.lbdie())
.field("lbdl", &self.lbdl())
.field("addm7", &self.addm7())
.finish()
}
}
impl W {
#[inline(always)]
pub fn addm7(&mut self) -> ADDM7_W<CR2rs> {
ADDM7_W::new(self, 4)
}
#[inline(always)]
pub fn lbdl(&mut self) -> LBDL_W<CR2rs> {
LBDL_W::new(self, 5)
}
#[inline(always)]
pub fn lbdie(&mut self) -> LBDIE_W<CR2rs> {
LBDIE_W::new(self, 6)
}
#[inline(always)]
pub fn lbcl(&mut self) -> LBCL_W<CR2rs> {
LBCL_W::new(self, 8)
}
#[inline(always)]
pub fn cpha(&mut self) -> CPHA_W<CR2rs> {
CPHA_W::new(self, 9)
}
#[inline(always)]
pub fn cpol(&mut self) -> CPOL_W<CR2rs> {
CPOL_W::new(self, 10)
}
#[inline(always)]
pub fn clken(&mut self) -> CLKEN_W<CR2rs> {
CLKEN_W::new(self, 11)
}
#[inline(always)]
pub fn stop(&mut self) -> STOP_W<CR2rs> {
STOP_W::new(self, 12)
}
#[inline(always)]
pub fn linen(&mut self) -> LINEN_W<CR2rs> {
LINEN_W::new(self, 14)
}
#[inline(always)]
pub fn swap(&mut self) -> SWAP_W<CR2rs> {
SWAP_W::new(self, 15)
}
#[inline(always)]
pub fn rxinv(&mut self) -> RXINV_W<CR2rs> {
RXINV_W::new(self, 16)
}
#[inline(always)]
pub fn txinv(&mut self) -> TXINV_W<CR2rs> {
TXINV_W::new(self, 17)
}
#[inline(always)]
pub fn datainv(&mut self) -> DATAINV_W<CR2rs> {
DATAINV_W::new(self, 18)
}
#[inline(always)]
pub fn msbfirst(&mut self) -> MSBFIRST_W<CR2rs> {
MSBFIRST_W::new(self, 19)
}
#[inline(always)]
pub fn abren(&mut self) -> ABREN_W<CR2rs> {
ABREN_W::new(self, 20)
}
#[inline(always)]
pub fn abrmod(&mut self) -> ABRMOD_W<CR2rs> {
ABRMOD_W::new(self, 21)
}
#[inline(always)]
pub fn rtoen(&mut self) -> RTOEN_W<CR2rs> {
RTOEN_W::new(self, 23)
}
#[inline(always)]
pub fn add(&mut self) -> ADD_W<CR2rs> {
ADD_W::new(self, 24)
}
}
pub struct CR2rs;
impl crate::RegisterSpec for CR2rs {
type Ux = u32;
}
impl crate::Readable for CR2rs {}
impl crate::Writable for CR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR2rs {}