pub type R = crate::R<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXIS {
NotRequired = 0,
Required = 1,
}
impl From<TXIS> for bool {
#[inline(always)]
fn from(variant: TXIS) -> Self {
variant as u8 != 0
}
}
pub type TXIS_R = crate::BitReader<TXIS>;
impl TXIS_R {
#[inline(always)]
pub const fn variant(&self) -> TXIS {
match self.bits {
false => TXIS::NotRequired,
true => TXIS::Required,
}
}
#[inline(always)]
pub fn is_not_required(&self) -> bool {
*self == TXIS::NotRequired
}
#[inline(always)]
pub fn is_required(&self) -> bool {
*self == TXIS::Required
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXMSGDISC {
NotDiscarded = 0,
Discarded = 1,
}
impl From<TXMSGDISC> for bool {
#[inline(always)]
fn from(variant: TXMSGDISC) -> Self {
variant as u8 != 0
}
}
pub type TXMSGDISC_R = crate::BitReader<TXMSGDISC>;
impl TXMSGDISC_R {
#[inline(always)]
pub const fn variant(&self) -> TXMSGDISC {
match self.bits {
false => TXMSGDISC::NotDiscarded,
true => TXMSGDISC::Discarded,
}
}
#[inline(always)]
pub fn is_not_discarded(&self) -> bool {
*self == TXMSGDISC::NotDiscarded
}
#[inline(always)]
pub fn is_discarded(&self) -> bool {
*self == TXMSGDISC::Discarded
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXMSGSENT {
NotCompleted = 0,
Completed = 1,
}
impl From<TXMSGSENT> for bool {
#[inline(always)]
fn from(variant: TXMSGSENT) -> Self {
variant as u8 != 0
}
}
pub type TXMSGSENT_R = crate::BitReader<TXMSGSENT>;
impl TXMSGSENT_R {
#[inline(always)]
pub const fn variant(&self) -> TXMSGSENT {
match self.bits {
false => TXMSGSENT::NotCompleted,
true => TXMSGSENT::Completed,
}
}
#[inline(always)]
pub fn is_not_completed(&self) -> bool {
*self == TXMSGSENT::NotCompleted
}
#[inline(always)]
pub fn is_completed(&self) -> bool {
*self == TXMSGSENT::Completed
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXMSGABT {
NoAbort = 0,
Abort = 1,
}
impl From<TXMSGABT> for bool {
#[inline(always)]
fn from(variant: TXMSGABT) -> Self {
variant as u8 != 0
}
}
pub type TXMSGABT_R = crate::BitReader<TXMSGABT>;
impl TXMSGABT_R {
#[inline(always)]
pub const fn variant(&self) -> TXMSGABT {
match self.bits {
false => TXMSGABT::NoAbort,
true => TXMSGABT::Abort,
}
}
#[inline(always)]
pub fn is_no_abort(&self) -> bool {
*self == TXMSGABT::NoAbort
}
#[inline(always)]
pub fn is_abort(&self) -> bool {
*self == TXMSGABT::Abort
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HRSTDISC {
NotDiscarded = 0,
Discarded = 1,
}
impl From<HRSTDISC> for bool {
#[inline(always)]
fn from(variant: HRSTDISC) -> Self {
variant as u8 != 0
}
}
pub type HRSTDISC_R = crate::BitReader<HRSTDISC>;
impl HRSTDISC_R {
#[inline(always)]
pub const fn variant(&self) -> HRSTDISC {
match self.bits {
false => HRSTDISC::NotDiscarded,
true => HRSTDISC::Discarded,
}
}
#[inline(always)]
pub fn is_not_discarded(&self) -> bool {
*self == HRSTDISC::NotDiscarded
}
#[inline(always)]
pub fn is_discarded(&self) -> bool {
*self == HRSTDISC::Discarded
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HRSTSENT {
NotSent = 0,
Sent = 1,
}
impl From<HRSTSENT> for bool {
#[inline(always)]
fn from(variant: HRSTSENT) -> Self {
variant as u8 != 0
}
}
pub type HRSTSENT_R = crate::BitReader<HRSTSENT>;
impl HRSTSENT_R {
#[inline(always)]
pub const fn variant(&self) -> HRSTSENT {
match self.bits {
false => HRSTSENT::NotSent,
true => HRSTSENT::Sent,
}
}
#[inline(always)]
pub fn is_not_sent(&self) -> bool {
*self == HRSTSENT::NotSent
}
#[inline(always)]
pub fn is_sent(&self) -> bool {
*self == HRSTSENT::Sent
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXUND {
NoUnderrun = 0,
Underrun = 1,
}
impl From<TXUND> for bool {
#[inline(always)]
fn from(variant: TXUND) -> Self {
variant as u8 != 0
}
}
pub type TXUND_R = crate::BitReader<TXUND>;
impl TXUND_R {
#[inline(always)]
pub const fn variant(&self) -> TXUND {
match self.bits {
false => TXUND::NoUnderrun,
true => TXUND::Underrun,
}
}
#[inline(always)]
pub fn is_no_underrun(&self) -> bool {
*self == TXUND::NoUnderrun
}
#[inline(always)]
pub fn is_underrun(&self) -> bool {
*self == TXUND::Underrun
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXNE {
Empty = 0,
NotEmpty = 1,
}
impl From<RXNE> for bool {
#[inline(always)]
fn from(variant: RXNE) -> Self {
variant as u8 != 0
}
}
pub type RXNE_R = crate::BitReader<RXNE>;
impl RXNE_R {
#[inline(always)]
pub const fn variant(&self) -> RXNE {
match self.bits {
false => RXNE::Empty,
true => RXNE::NotEmpty,
}
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == RXNE::Empty
}
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
*self == RXNE::NotEmpty
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXORDDET {
NoOrderedSet = 0,
OrderedSet = 1,
}
impl From<RXORDDET> for bool {
#[inline(always)]
fn from(variant: RXORDDET) -> Self {
variant as u8 != 0
}
}
pub type RXORDDET_R = crate::BitReader<RXORDDET>;
impl RXORDDET_R {
#[inline(always)]
pub const fn variant(&self) -> RXORDDET {
match self.bits {
false => RXORDDET::NoOrderedSet,
true => RXORDDET::OrderedSet,
}
}
#[inline(always)]
pub fn is_no_ordered_set(&self) -> bool {
*self == RXORDDET::NoOrderedSet
}
#[inline(always)]
pub fn is_ordered_set(&self) -> bool {
*self == RXORDDET::OrderedSet
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXHRSTDET {
NoHardReset = 0,
HardReset = 1,
}
impl From<RXHRSTDET> for bool {
#[inline(always)]
fn from(variant: RXHRSTDET) -> Self {
variant as u8 != 0
}
}
pub type RXHRSTDET_R = crate::BitReader<RXHRSTDET>;
impl RXHRSTDET_R {
#[inline(always)]
pub const fn variant(&self) -> RXHRSTDET {
match self.bits {
false => RXHRSTDET::NoHardReset,
true => RXHRSTDET::HardReset,
}
}
#[inline(always)]
pub fn is_no_hard_reset(&self) -> bool {
*self == RXHRSTDET::NoHardReset
}
#[inline(always)]
pub fn is_hard_reset(&self) -> bool {
*self == RXHRSTDET::HardReset
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXOVR {
NoOverflow = 0,
Overflow = 1,
}
impl From<RXOVR> for bool {
#[inline(always)]
fn from(variant: RXOVR) -> Self {
variant as u8 != 0
}
}
pub type RXOVR_R = crate::BitReader<RXOVR>;
impl RXOVR_R {
#[inline(always)]
pub const fn variant(&self) -> RXOVR {
match self.bits {
false => RXOVR::NoOverflow,
true => RXOVR::Overflow,
}
}
#[inline(always)]
pub fn is_no_overflow(&self) -> bool {
*self == RXOVR::NoOverflow
}
#[inline(always)]
pub fn is_overflow(&self) -> bool {
*self == RXOVR::Overflow
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXMSGEND {
NoNewMessage = 0,
NewMessage = 1,
}
impl From<RXMSGEND> for bool {
#[inline(always)]
fn from(variant: RXMSGEND) -> Self {
variant as u8 != 0
}
}
pub type RXMSGEND_R = crate::BitReader<RXMSGEND>;
impl RXMSGEND_R {
#[inline(always)]
pub const fn variant(&self) -> RXMSGEND {
match self.bits {
false => RXMSGEND::NoNewMessage,
true => RXMSGEND::NewMessage,
}
}
#[inline(always)]
pub fn is_no_new_message(&self) -> bool {
*self == RXMSGEND::NoNewMessage
}
#[inline(always)]
pub fn is_new_message(&self) -> bool {
*self == RXMSGEND::NewMessage
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXERR {
NoError = 0,
Error = 1,
}
impl From<RXERR> for bool {
#[inline(always)]
fn from(variant: RXERR) -> Self {
variant as u8 != 0
}
}
pub type RXERR_R = crate::BitReader<RXERR>;
impl RXERR_R {
#[inline(always)]
pub const fn variant(&self) -> RXERR {
match self.bits {
false => RXERR::NoError,
true => RXERR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == RXERR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == RXERR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TYPECEVT1 {
NoNewEvent = 0,
NewEvent = 1,
}
impl From<TYPECEVT1> for bool {
#[inline(always)]
fn from(variant: TYPECEVT1) -> Self {
variant as u8 != 0
}
}
pub type TYPECEVT1_R = crate::BitReader<TYPECEVT1>;
impl TYPECEVT1_R {
#[inline(always)]
pub const fn variant(&self) -> TYPECEVT1 {
match self.bits {
false => TYPECEVT1::NoNewEvent,
true => TYPECEVT1::NewEvent,
}
}
#[inline(always)]
pub fn is_no_new_event(&self) -> bool {
*self == TYPECEVT1::NoNewEvent
}
#[inline(always)]
pub fn is_new_event(&self) -> bool {
*self == TYPECEVT1::NewEvent
}
}
pub use TYPECEVT1_R as TYPECEVT2_R;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TYPEC_VSTATE_CC1 {
Lowest = 0,
Low = 1,
High = 2,
Highest = 3,
}
impl From<TYPEC_VSTATE_CC1> for u8 {
#[inline(always)]
fn from(variant: TYPEC_VSTATE_CC1) -> Self {
variant as _
}
}
impl crate::FieldSpec for TYPEC_VSTATE_CC1 {
type Ux = u8;
}
impl crate::IsEnum for TYPEC_VSTATE_CC1 {}
pub type TYPEC_VSTATE_CC1_R = crate::FieldReader<TYPEC_VSTATE_CC1>;
impl TYPEC_VSTATE_CC1_R {
#[inline(always)]
pub const fn variant(&self) -> TYPEC_VSTATE_CC1 {
match self.bits {
0 => TYPEC_VSTATE_CC1::Lowest,
1 => TYPEC_VSTATE_CC1::Low,
2 => TYPEC_VSTATE_CC1::High,
3 => TYPEC_VSTATE_CC1::Highest,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_lowest(&self) -> bool {
*self == TYPEC_VSTATE_CC1::Lowest
}
#[inline(always)]
pub fn is_low(&self) -> bool {
*self == TYPEC_VSTATE_CC1::Low
}
#[inline(always)]
pub fn is_high(&self) -> bool {
*self == TYPEC_VSTATE_CC1::High
}
#[inline(always)]
pub fn is_highest(&self) -> bool {
*self == TYPEC_VSTATE_CC1::Highest
}
}
pub use TYPEC_VSTATE_CC1_R as TYPEC_VSTATE_CC2_R;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FRSEVT {
NoNewEvent = 0,
NewEvent = 1,
}
impl From<FRSEVT> for bool {
#[inline(always)]
fn from(variant: FRSEVT) -> Self {
variant as u8 != 0
}
}
pub type FRSEVT_R = crate::BitReader<FRSEVT>;
impl FRSEVT_R {
#[inline(always)]
pub const fn variant(&self) -> FRSEVT {
match self.bits {
false => FRSEVT::NoNewEvent,
true => FRSEVT::NewEvent,
}
}
#[inline(always)]
pub fn is_no_new_event(&self) -> bool {
*self == FRSEVT::NoNewEvent
}
#[inline(always)]
pub fn is_new_event(&self) -> bool {
*self == FRSEVT::NewEvent
}
}
impl R {
#[inline(always)]
pub fn txis(&self) -> TXIS_R {
TXIS_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn txmsgdisc(&self) -> TXMSGDISC_R {
TXMSGDISC_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn txmsgsent(&self) -> TXMSGSENT_R {
TXMSGSENT_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn txmsgabt(&self) -> TXMSGABT_R {
TXMSGABT_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn hrstdisc(&self) -> HRSTDISC_R {
HRSTDISC_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn hrstsent(&self) -> HRSTSENT_R {
HRSTSENT_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn txund(&self) -> TXUND_R {
TXUND_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn rxne(&self) -> RXNE_R {
RXNE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn rxorddet(&self) -> RXORDDET_R {
RXORDDET_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn rxhrstdet(&self) -> RXHRSTDET_R {
RXHRSTDET_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn rxovr(&self) -> RXOVR_R {
RXOVR_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn rxmsgend(&self) -> RXMSGEND_R {
RXMSGEND_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn rxerr(&self) -> RXERR_R {
RXERR_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn typecevt1(&self) -> TYPECEVT1_R {
TYPECEVT1_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn typecevt2(&self) -> TYPECEVT2_R {
TYPECEVT2_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn typec_vstate_cc1(&self) -> TYPEC_VSTATE_CC1_R {
TYPEC_VSTATE_CC1_R::new(((self.bits >> 16) & 3) as u8)
}
#[inline(always)]
pub fn typec_vstate_cc2(&self) -> TYPEC_VSTATE_CC2_R {
TYPEC_VSTATE_CC2_R::new(((self.bits >> 18) & 3) as u8)
}
#[inline(always)]
pub fn frsevt(&self) -> FRSEVT_R {
FRSEVT_R::new(((self.bits >> 20) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("txis", &self.txis())
.field("txmsgdisc", &self.txmsgdisc())
.field("txmsgsent", &self.txmsgsent())
.field("txmsgabt", &self.txmsgabt())
.field("hrstdisc", &self.hrstdisc())
.field("hrstsent", &self.hrstsent())
.field("txund", &self.txund())
.field("rxne", &self.rxne())
.field("rxorddet", &self.rxorddet())
.field("rxhrstdet", &self.rxhrstdet())
.field("rxovr", &self.rxovr())
.field("rxmsgend", &self.rxmsgend())
.field("rxerr", &self.rxerr())
.field("typecevt1", &self.typecevt1())
.field("typecevt2", &self.typecevt2())
.field("typec_vstate_cc1", &self.typec_vstate_cc1())
.field("typec_vstate_cc2", &self.typec_vstate_cc2())
.field("frsevt", &self.frsevt())
.finish()
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Resettable for SRrs {}