pub type R = crate::R<CR1rs>;
pub type W = crate::W<CR1rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PE {
Disabled = 0,
Enabled = 1,
}
impl From<PE> for bool {
#[inline(always)]
fn from(variant: PE) -> Self {
variant as u8 != 0
}
}
pub type PE_R = crate::BitReader<PE>;
impl PE_R {
#[inline(always)]
pub const fn variant(&self) -> PE {
match self.bits {
false => PE::Disabled,
true => PE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PE::Enabled
}
}
pub type PE_W<'a, REG> = crate::BitWriter<'a, REG, PE>;
impl<'a, REG> PE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXIE {
Disabled = 0,
Enabled = 1,
}
impl From<TXIE> for bool {
#[inline(always)]
fn from(variant: TXIE) -> Self {
variant as u8 != 0
}
}
pub type TXIE_R = crate::BitReader<TXIE>;
impl TXIE_R {
#[inline(always)]
pub const fn variant(&self) -> TXIE {
match self.bits {
false => TXIE::Disabled,
true => TXIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TXIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TXIE::Enabled
}
}
pub type TXIE_W<'a, REG> = crate::BitWriter<'a, REG, TXIE>;
impl<'a, REG> TXIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TXIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TXIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXIE {
Disabled = 0,
Enabled = 1,
}
impl From<RXIE> for bool {
#[inline(always)]
fn from(variant: RXIE) -> Self {
variant as u8 != 0
}
}
pub type RXIE_R = crate::BitReader<RXIE>;
impl RXIE_R {
#[inline(always)]
pub const fn variant(&self) -> RXIE {
match self.bits {
false => RXIE::Disabled,
true => RXIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RXIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RXIE::Enabled
}
}
pub type RXIE_W<'a, REG> = crate::BitWriter<'a, REG, RXIE>;
impl<'a, REG> RXIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RXIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RXIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADDRIE {
Disabled = 0,
Enabled = 1,
}
impl From<ADDRIE> for bool {
#[inline(always)]
fn from(variant: ADDRIE) -> Self {
variant as u8 != 0
}
}
pub type ADDRIE_R = crate::BitReader<ADDRIE>;
impl ADDRIE_R {
#[inline(always)]
pub const fn variant(&self) -> ADDRIE {
match self.bits {
false => ADDRIE::Disabled,
true => ADDRIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ADDRIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ADDRIE::Enabled
}
}
pub type ADDRIE_W<'a, REG> = crate::BitWriter<'a, REG, ADDRIE>;
impl<'a, REG> ADDRIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ADDRIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ADDRIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NACKIE {
Disabled = 0,
Enabled = 1,
}
impl From<NACKIE> for bool {
#[inline(always)]
fn from(variant: NACKIE) -> Self {
variant as u8 != 0
}
}
pub type NACKIE_R = crate::BitReader<NACKIE>;
impl NACKIE_R {
#[inline(always)]
pub const fn variant(&self) -> NACKIE {
match self.bits {
false => NACKIE::Disabled,
true => NACKIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == NACKIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == NACKIE::Enabled
}
}
pub type NACKIE_W<'a, REG> = crate::BitWriter<'a, REG, NACKIE>;
impl<'a, REG> NACKIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(NACKIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(NACKIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum STOPIE {
Disabled = 0,
Enabled = 1,
}
impl From<STOPIE> for bool {
#[inline(always)]
fn from(variant: STOPIE) -> Self {
variant as u8 != 0
}
}
pub type STOPIE_R = crate::BitReader<STOPIE>;
impl STOPIE_R {
#[inline(always)]
pub const fn variant(&self) -> STOPIE {
match self.bits {
false => STOPIE::Disabled,
true => STOPIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == STOPIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == STOPIE::Enabled
}
}
pub type STOPIE_W<'a, REG> = crate::BitWriter<'a, REG, STOPIE>;
impl<'a, REG> STOPIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(STOPIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(STOPIE::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 ERRIE {
Disabled = 0,
Enabled = 1,
}
impl From<ERRIE> for bool {
#[inline(always)]
fn from(variant: ERRIE) -> Self {
variant as u8 != 0
}
}
pub type ERRIE_R = crate::BitReader<ERRIE>;
impl ERRIE_R {
#[inline(always)]
pub const fn variant(&self) -> ERRIE {
match self.bits {
false => ERRIE::Disabled,
true => ERRIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ERRIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ERRIE::Enabled
}
}
pub type ERRIE_W<'a, REG> = crate::BitWriter<'a, REG, ERRIE>;
impl<'a, REG> ERRIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ERRIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ERRIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DNF {
NoFilter = 0,
Filter1 = 1,
Filter2 = 2,
Filter3 = 3,
Filter4 = 4,
Filter5 = 5,
Filter6 = 6,
Filter7 = 7,
Filter8 = 8,
Filter9 = 9,
Filter10 = 10,
Filter11 = 11,
Filter12 = 12,
Filter13 = 13,
Filter14 = 14,
Filter15 = 15,
}
impl From<DNF> for u8 {
#[inline(always)]
fn from(variant: DNF) -> Self {
variant as _
}
}
impl crate::FieldSpec for DNF {
type Ux = u8;
}
impl crate::IsEnum for DNF {}
pub type DNF_R = crate::FieldReader<DNF>;
impl DNF_R {
#[inline(always)]
pub const fn variant(&self) -> DNF {
match self.bits {
0 => DNF::NoFilter,
1 => DNF::Filter1,
2 => DNF::Filter2,
3 => DNF::Filter3,
4 => DNF::Filter4,
5 => DNF::Filter5,
6 => DNF::Filter6,
7 => DNF::Filter7,
8 => DNF::Filter8,
9 => DNF::Filter9,
10 => DNF::Filter10,
11 => DNF::Filter11,
12 => DNF::Filter12,
13 => DNF::Filter13,
14 => DNF::Filter14,
15 => DNF::Filter15,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_filter(&self) -> bool {
*self == DNF::NoFilter
}
#[inline(always)]
pub fn is_filter1(&self) -> bool {
*self == DNF::Filter1
}
#[inline(always)]
pub fn is_filter2(&self) -> bool {
*self == DNF::Filter2
}
#[inline(always)]
pub fn is_filter3(&self) -> bool {
*self == DNF::Filter3
}
#[inline(always)]
pub fn is_filter4(&self) -> bool {
*self == DNF::Filter4
}
#[inline(always)]
pub fn is_filter5(&self) -> bool {
*self == DNF::Filter5
}
#[inline(always)]
pub fn is_filter6(&self) -> bool {
*self == DNF::Filter6
}
#[inline(always)]
pub fn is_filter7(&self) -> bool {
*self == DNF::Filter7
}
#[inline(always)]
pub fn is_filter8(&self) -> bool {
*self == DNF::Filter8
}
#[inline(always)]
pub fn is_filter9(&self) -> bool {
*self == DNF::Filter9
}
#[inline(always)]
pub fn is_filter10(&self) -> bool {
*self == DNF::Filter10
}
#[inline(always)]
pub fn is_filter11(&self) -> bool {
*self == DNF::Filter11
}
#[inline(always)]
pub fn is_filter12(&self) -> bool {
*self == DNF::Filter12
}
#[inline(always)]
pub fn is_filter13(&self) -> bool {
*self == DNF::Filter13
}
#[inline(always)]
pub fn is_filter14(&self) -> bool {
*self == DNF::Filter14
}
#[inline(always)]
pub fn is_filter15(&self) -> bool {
*self == DNF::Filter15
}
}
pub type DNF_W<'a, REG> = crate::FieldWriter<'a, REG, 4, DNF, crate::Safe>;
impl<'a, REG> DNF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_filter(self) -> &'a mut crate::W<REG> {
self.variant(DNF::NoFilter)
}
#[inline(always)]
pub fn filter1(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter1)
}
#[inline(always)]
pub fn filter2(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter2)
}
#[inline(always)]
pub fn filter3(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter3)
}
#[inline(always)]
pub fn filter4(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter4)
}
#[inline(always)]
pub fn filter5(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter5)
}
#[inline(always)]
pub fn filter6(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter6)
}
#[inline(always)]
pub fn filter7(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter7)
}
#[inline(always)]
pub fn filter8(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter8)
}
#[inline(always)]
pub fn filter9(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter9)
}
#[inline(always)]
pub fn filter10(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter10)
}
#[inline(always)]
pub fn filter11(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter11)
}
#[inline(always)]
pub fn filter12(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter12)
}
#[inline(always)]
pub fn filter13(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter13)
}
#[inline(always)]
pub fn filter14(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter14)
}
#[inline(always)]
pub fn filter15(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter15)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ANFOFF {
Enabled = 0,
Disabled = 1,
}
impl From<ANFOFF> for bool {
#[inline(always)]
fn from(variant: ANFOFF) -> Self {
variant as u8 != 0
}
}
pub type ANFOFF_R = crate::BitReader<ANFOFF>;
impl ANFOFF_R {
#[inline(always)]
pub const fn variant(&self) -> ANFOFF {
match self.bits {
false => ANFOFF::Enabled,
true => ANFOFF::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ANFOFF::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ANFOFF::Disabled
}
}
pub type ANFOFF_W<'a, REG> = crate::BitWriter<'a, REG, ANFOFF>;
impl<'a, REG> ANFOFF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ANFOFF::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ANFOFF::Disabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXDMAEN {
Disabled = 0,
Enabled = 1,
}
impl From<TXDMAEN> for bool {
#[inline(always)]
fn from(variant: TXDMAEN) -> Self {
variant as u8 != 0
}
}
pub type TXDMAEN_R = crate::BitReader<TXDMAEN>;
impl TXDMAEN_R {
#[inline(always)]
pub const fn variant(&self) -> TXDMAEN {
match self.bits {
false => TXDMAEN::Disabled,
true => TXDMAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TXDMAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TXDMAEN::Enabled
}
}
pub type TXDMAEN_W<'a, REG> = crate::BitWriter<'a, REG, TXDMAEN>;
impl<'a, REG> TXDMAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TXDMAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TXDMAEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXDMAEN {
Disabled = 0,
Enabled = 1,
}
impl From<RXDMAEN> for bool {
#[inline(always)]
fn from(variant: RXDMAEN) -> Self {
variant as u8 != 0
}
}
pub type RXDMAEN_R = crate::BitReader<RXDMAEN>;
impl RXDMAEN_R {
#[inline(always)]
pub const fn variant(&self) -> RXDMAEN {
match self.bits {
false => RXDMAEN::Disabled,
true => RXDMAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RXDMAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RXDMAEN::Enabled
}
}
pub type RXDMAEN_W<'a, REG> = crate::BitWriter<'a, REG, RXDMAEN>;
impl<'a, REG> RXDMAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RXDMAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RXDMAEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SBC {
Disabled = 0,
Enabled = 1,
}
impl From<SBC> for bool {
#[inline(always)]
fn from(variant: SBC) -> Self {
variant as u8 != 0
}
}
pub type SBC_R = crate::BitReader<SBC>;
impl SBC_R {
#[inline(always)]
pub const fn variant(&self) -> SBC {
match self.bits {
false => SBC::Disabled,
true => SBC::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SBC::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SBC::Enabled
}
}
pub type SBC_W<'a, REG> = crate::BitWriter<'a, REG, SBC>;
impl<'a, REG> SBC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SBC::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SBC::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NOSTRETCH {
Enabled = 0,
Disabled = 1,
}
impl From<NOSTRETCH> for bool {
#[inline(always)]
fn from(variant: NOSTRETCH) -> Self {
variant as u8 != 0
}
}
pub type NOSTRETCH_R = crate::BitReader<NOSTRETCH>;
impl NOSTRETCH_R {
#[inline(always)]
pub const fn variant(&self) -> NOSTRETCH {
match self.bits {
false => NOSTRETCH::Enabled,
true => NOSTRETCH::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == NOSTRETCH::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == NOSTRETCH::Disabled
}
}
pub type NOSTRETCH_W<'a, REG> = crate::BitWriter<'a, REG, NOSTRETCH>;
impl<'a, REG> NOSTRETCH_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(NOSTRETCH::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(NOSTRETCH::Disabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUPEN {
Disabled = 0,
Enabled = 1,
}
impl From<WUPEN> for bool {
#[inline(always)]
fn from(variant: WUPEN) -> Self {
variant as u8 != 0
}
}
pub type WUPEN_R = crate::BitReader<WUPEN>;
impl WUPEN_R {
#[inline(always)]
pub const fn variant(&self) -> WUPEN {
match self.bits {
false => WUPEN::Disabled,
true => WUPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WUPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WUPEN::Enabled
}
}
pub type WUPEN_W<'a, REG> = crate::BitWriter<'a, REG, WUPEN>;
impl<'a, REG> WUPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WUPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WUPEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum GCEN {
Disabled = 0,
Enabled = 1,
}
impl From<GCEN> for bool {
#[inline(always)]
fn from(variant: GCEN) -> Self {
variant as u8 != 0
}
}
pub type GCEN_R = crate::BitReader<GCEN>;
impl GCEN_R {
#[inline(always)]
pub const fn variant(&self) -> GCEN {
match self.bits {
false => GCEN::Disabled,
true => GCEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == GCEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == GCEN::Enabled
}
}
pub type GCEN_W<'a, REG> = crate::BitWriter<'a, REG, GCEN>;
impl<'a, REG> GCEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(GCEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(GCEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SMBHEN {
Disabled = 0,
Enabled = 1,
}
impl From<SMBHEN> for bool {
#[inline(always)]
fn from(variant: SMBHEN) -> Self {
variant as u8 != 0
}
}
pub type SMBHEN_R = crate::BitReader<SMBHEN>;
impl SMBHEN_R {
#[inline(always)]
pub const fn variant(&self) -> SMBHEN {
match self.bits {
false => SMBHEN::Disabled,
true => SMBHEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SMBHEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SMBHEN::Enabled
}
}
pub type SMBHEN_W<'a, REG> = crate::BitWriter<'a, REG, SMBHEN>;
impl<'a, REG> SMBHEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SMBHEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SMBHEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SMBDEN {
Disabled = 0,
Enabled = 1,
}
impl From<SMBDEN> for bool {
#[inline(always)]
fn from(variant: SMBDEN) -> Self {
variant as u8 != 0
}
}
pub type SMBDEN_R = crate::BitReader<SMBDEN>;
impl SMBDEN_R {
#[inline(always)]
pub const fn variant(&self) -> SMBDEN {
match self.bits {
false => SMBDEN::Disabled,
true => SMBDEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SMBDEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SMBDEN::Enabled
}
}
pub type SMBDEN_W<'a, REG> = crate::BitWriter<'a, REG, SMBDEN>;
impl<'a, REG> SMBDEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SMBDEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SMBDEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALERTEN {
Disabled = 0,
Enabled = 1,
}
impl From<ALERTEN> for bool {
#[inline(always)]
fn from(variant: ALERTEN) -> Self {
variant as u8 != 0
}
}
pub type ALERTEN_R = crate::BitReader<ALERTEN>;
impl ALERTEN_R {
#[inline(always)]
pub const fn variant(&self) -> ALERTEN {
match self.bits {
false => ALERTEN::Disabled,
true => ALERTEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALERTEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALERTEN::Enabled
}
}
pub type ALERTEN_W<'a, REG> = crate::BitWriter<'a, REG, ALERTEN>;
impl<'a, REG> ALERTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ALERTEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ALERTEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PECEN {
Disabled = 0,
Enabled = 1,
}
impl From<PECEN> for bool {
#[inline(always)]
fn from(variant: PECEN) -> Self {
variant as u8 != 0
}
}
pub type PECEN_R = crate::BitReader<PECEN>;
impl PECEN_R {
#[inline(always)]
pub const fn variant(&self) -> PECEN {
match self.bits {
false => PECEN::Disabled,
true => PECEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PECEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PECEN::Enabled
}
}
pub type PECEN_W<'a, REG> = crate::BitWriter<'a, REG, PECEN>;
impl<'a, REG> PECEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PECEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PECEN::Enabled)
}
}
impl R {
#[inline(always)]
pub fn pe(&self) -> PE_R {
PE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn txie(&self) -> TXIE_R {
TXIE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn rxie(&self) -> RXIE_R {
RXIE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn addrie(&self) -> ADDRIE_R {
ADDRIE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn nackie(&self) -> NACKIE_R {
NACKIE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn stopie(&self) -> STOPIE_R {
STOPIE_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn tcie(&self) -> TCIE_R {
TCIE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn errie(&self) -> ERRIE_R {
ERRIE_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn dnf(&self) -> DNF_R {
DNF_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn anfoff(&self) -> ANFOFF_R {
ANFOFF_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn txdmaen(&self) -> TXDMAEN_R {
TXDMAEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn rxdmaen(&self) -> RXDMAEN_R {
RXDMAEN_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn sbc(&self) -> SBC_R {
SBC_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn nostretch(&self) -> NOSTRETCH_R {
NOSTRETCH_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn wupen(&self) -> WUPEN_R {
WUPEN_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn gcen(&self) -> GCEN_R {
GCEN_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn smbhen(&self) -> SMBHEN_R {
SMBHEN_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn smbden(&self) -> SMBDEN_R {
SMBDEN_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn alerten(&self) -> ALERTEN_R {
ALERTEN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn pecen(&self) -> PECEN_R {
PECEN_R::new(((self.bits >> 23) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR1")
.field("pe", &self.pe())
.field("txie", &self.txie())
.field("rxie", &self.rxie())
.field("addrie", &self.addrie())
.field("nackie", &self.nackie())
.field("stopie", &self.stopie())
.field("tcie", &self.tcie())
.field("errie", &self.errie())
.field("dnf", &self.dnf())
.field("anfoff", &self.anfoff())
.field("txdmaen", &self.txdmaen())
.field("rxdmaen", &self.rxdmaen())
.field("sbc", &self.sbc())
.field("nostretch", &self.nostretch())
.field("wupen", &self.wupen())
.field("gcen", &self.gcen())
.field("smbhen", &self.smbhen())
.field("smbden", &self.smbden())
.field("alerten", &self.alerten())
.field("pecen", &self.pecen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pe(&mut self) -> PE_W<CR1rs> {
PE_W::new(self, 0)
}
#[inline(always)]
pub fn txie(&mut self) -> TXIE_W<CR1rs> {
TXIE_W::new(self, 1)
}
#[inline(always)]
pub fn rxie(&mut self) -> RXIE_W<CR1rs> {
RXIE_W::new(self, 2)
}
#[inline(always)]
pub fn addrie(&mut self) -> ADDRIE_W<CR1rs> {
ADDRIE_W::new(self, 3)
}
#[inline(always)]
pub fn nackie(&mut self) -> NACKIE_W<CR1rs> {
NACKIE_W::new(self, 4)
}
#[inline(always)]
pub fn stopie(&mut self) -> STOPIE_W<CR1rs> {
STOPIE_W::new(self, 5)
}
#[inline(always)]
pub fn tcie(&mut self) -> TCIE_W<CR1rs> {
TCIE_W::new(self, 6)
}
#[inline(always)]
pub fn errie(&mut self) -> ERRIE_W<CR1rs> {
ERRIE_W::new(self, 7)
}
#[inline(always)]
pub fn dnf(&mut self) -> DNF_W<CR1rs> {
DNF_W::new(self, 8)
}
#[inline(always)]
pub fn anfoff(&mut self) -> ANFOFF_W<CR1rs> {
ANFOFF_W::new(self, 12)
}
#[inline(always)]
pub fn txdmaen(&mut self) -> TXDMAEN_W<CR1rs> {
TXDMAEN_W::new(self, 14)
}
#[inline(always)]
pub fn rxdmaen(&mut self) -> RXDMAEN_W<CR1rs> {
RXDMAEN_W::new(self, 15)
}
#[inline(always)]
pub fn sbc(&mut self) -> SBC_W<CR1rs> {
SBC_W::new(self, 16)
}
#[inline(always)]
pub fn nostretch(&mut self) -> NOSTRETCH_W<CR1rs> {
NOSTRETCH_W::new(self, 17)
}
#[inline(always)]
pub fn wupen(&mut self) -> WUPEN_W<CR1rs> {
WUPEN_W::new(self, 18)
}
#[inline(always)]
pub fn gcen(&mut self) -> GCEN_W<CR1rs> {
GCEN_W::new(self, 19)
}
#[inline(always)]
pub fn smbhen(&mut self) -> SMBHEN_W<CR1rs> {
SMBHEN_W::new(self, 20)
}
#[inline(always)]
pub fn smbden(&mut self) -> SMBDEN_W<CR1rs> {
SMBDEN_W::new(self, 21)
}
#[inline(always)]
pub fn alerten(&mut self) -> ALERTEN_W<CR1rs> {
ALERTEN_W::new(self, 22)
}
#[inline(always)]
pub fn pecen(&mut self) -> PECEN_W<CR1rs> {
PECEN_W::new(self, 23)
}
}
pub struct CR1rs;
impl crate::RegisterSpec for CR1rs {
type Ux = u32;
}
impl crate::Readable for CR1rs {}
impl crate::Writable for CR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR1rs {}