pub type R = crate::R<SR1rs>;
pub type W = crate::W<SR1rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SB {
NoStart = 0,
Start = 1,
}
impl From<SB> for bool {
#[inline(always)]
fn from(variant: SB) -> Self {
variant as u8 != 0
}
}
pub type SB_R = crate::BitReader<SB>;
impl SB_R {
#[inline(always)]
pub const fn variant(&self) -> SB {
match self.bits {
false => SB::NoStart,
true => SB::Start,
}
}
#[inline(always)]
pub fn is_no_start(&self) -> bool {
*self == SB::NoStart
}
#[inline(always)]
pub fn is_start(&self) -> bool {
*self == SB::Start
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ADDR {
NotMatch = 0,
Match = 1,
}
impl From<ADDR> for bool {
#[inline(always)]
fn from(variant: ADDR) -> Self {
variant as u8 != 0
}
}
pub type ADDR_R = crate::BitReader<ADDR>;
impl ADDR_R {
#[inline(always)]
pub const fn variant(&self) -> ADDR {
match self.bits {
false => ADDR::NotMatch,
true => ADDR::Match,
}
}
#[inline(always)]
pub fn is_not_match(&self) -> bool {
*self == ADDR::NotMatch
}
#[inline(always)]
pub fn is_match(&self) -> bool {
*self == ADDR::Match
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BTF {
NotFinished = 0,
Finished = 1,
}
impl From<BTF> for bool {
#[inline(always)]
fn from(variant: BTF) -> Self {
variant as u8 != 0
}
}
pub type BTF_R = crate::BitReader<BTF>;
impl BTF_R {
#[inline(always)]
pub const fn variant(&self) -> BTF {
match self.bits {
false => BTF::NotFinished,
true => BTF::Finished,
}
}
#[inline(always)]
pub fn is_not_finished(&self) -> bool {
*self == BTF::NotFinished
}
#[inline(always)]
pub fn is_finished(&self) -> bool {
*self == BTF::Finished
}
}
pub type ADD10_R = crate::BitReader;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum STOPF {
NoStop = 0,
Stop = 1,
}
impl From<STOPF> for bool {
#[inline(always)]
fn from(variant: STOPF) -> Self {
variant as u8 != 0
}
}
pub type STOPF_R = crate::BitReader<STOPF>;
impl STOPF_R {
#[inline(always)]
pub const fn variant(&self) -> STOPF {
match self.bits {
false => STOPF::NoStop,
true => STOPF::Stop,
}
}
#[inline(always)]
pub fn is_no_stop(&self) -> bool {
*self == STOPF::NoStop
}
#[inline(always)]
pub fn is_stop(&self) -> bool {
*self == STOPF::Stop
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RX_NE {
Empty = 0,
NotEmpty = 1,
}
impl From<RX_NE> for bool {
#[inline(always)]
fn from(variant: RX_NE) -> Self {
variant as u8 != 0
}
}
pub type RX_NE_R = crate::BitReader<RX_NE>;
impl RX_NE_R {
#[inline(always)]
pub const fn variant(&self) -> RX_NE {
match self.bits {
false => RX_NE::Empty,
true => RX_NE::NotEmpty,
}
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == RX_NE::Empty
}
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
*self == RX_NE::NotEmpty
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TX_E {
NotEmpty = 0,
Empty = 1,
}
impl From<TX_E> for bool {
#[inline(always)]
fn from(variant: TX_E) -> Self {
variant as u8 != 0
}
}
pub type TX_E_R = crate::BitReader<TX_E>;
impl TX_E_R {
#[inline(always)]
pub const fn variant(&self) -> TX_E {
match self.bits {
false => TX_E::NotEmpty,
true => TX_E::Empty,
}
}
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
*self == TX_E::NotEmpty
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == TX_E::Empty
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BERRR {
NoError = 0,
Error = 1,
}
impl From<BERRR> for bool {
#[inline(always)]
fn from(variant: BERRR) -> Self {
variant as u8 != 0
}
}
pub type BERR_R = crate::BitReader<BERRR>;
impl BERR_R {
#[inline(always)]
pub const fn variant(&self) -> BERRR {
match self.bits {
false => BERRR::NoError,
true => BERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == BERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == BERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BERRW {
Clear = 0,
}
impl From<BERRW> for bool {
#[inline(always)]
fn from(variant: BERRW) -> Self {
variant as u8 != 0
}
}
pub type BERR_W<'a, REG> = crate::BitWriter0C<'a, REG, BERRW>;
impl<'a, REG> BERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(BERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ARLOR {
NoLost = 0,
Lost = 1,
}
impl From<ARLOR> for bool {
#[inline(always)]
fn from(variant: ARLOR) -> Self {
variant as u8 != 0
}
}
pub type ARLO_R = crate::BitReader<ARLOR>;
impl ARLO_R {
#[inline(always)]
pub const fn variant(&self) -> ARLOR {
match self.bits {
false => ARLOR::NoLost,
true => ARLOR::Lost,
}
}
#[inline(always)]
pub fn is_no_lost(&self) -> bool {
*self == ARLOR::NoLost
}
#[inline(always)]
pub fn is_lost(&self) -> bool {
*self == ARLOR::Lost
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ARLOW {
Clear = 0,
}
impl From<ARLOW> for bool {
#[inline(always)]
fn from(variant: ARLOW) -> Self {
variant as u8 != 0
}
}
pub type ARLO_W<'a, REG> = crate::BitWriter0C<'a, REG, ARLOW>;
impl<'a, REG> ARLO_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(ARLOW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AFR {
NoFailure = 0,
Failure = 1,
}
impl From<AFR> for bool {
#[inline(always)]
fn from(variant: AFR) -> Self {
variant as u8 != 0
}
}
pub type AF_R = crate::BitReader<AFR>;
impl AF_R {
#[inline(always)]
pub const fn variant(&self) -> AFR {
match self.bits {
false => AFR::NoFailure,
true => AFR::Failure,
}
}
#[inline(always)]
pub fn is_no_failure(&self) -> bool {
*self == AFR::NoFailure
}
#[inline(always)]
pub fn is_failure(&self) -> bool {
*self == AFR::Failure
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AFW {
Clear = 0,
}
impl From<AFW> for bool {
#[inline(always)]
fn from(variant: AFW) -> Self {
variant as u8 != 0
}
}
pub type AF_W<'a, REG> = crate::BitWriter0C<'a, REG, AFW>;
impl<'a, REG> AF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(AFW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OVRR {
NoOverrun = 0,
Overrun = 1,
}
impl From<OVRR> for bool {
#[inline(always)]
fn from(variant: OVRR) -> Self {
variant as u8 != 0
}
}
pub type OVR_R = crate::BitReader<OVRR>;
impl OVR_R {
#[inline(always)]
pub const fn variant(&self) -> OVRR {
match self.bits {
false => OVRR::NoOverrun,
true => OVRR::Overrun,
}
}
#[inline(always)]
pub fn is_no_overrun(&self) -> bool {
*self == OVRR::NoOverrun
}
#[inline(always)]
pub fn is_overrun(&self) -> bool {
*self == OVRR::Overrun
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OVRW {
Clear = 0,
}
impl From<OVRW> for bool {
#[inline(always)]
fn from(variant: OVRW) -> Self {
variant as u8 != 0
}
}
pub type OVR_W<'a, REG> = crate::BitWriter0C<'a, REG, OVRW>;
impl<'a, REG> OVR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(OVRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PECERRR {
NoError = 0,
Error = 1,
}
impl From<PECERRR> for bool {
#[inline(always)]
fn from(variant: PECERRR) -> Self {
variant as u8 != 0
}
}
pub type PECERR_R = crate::BitReader<PECERRR>;
impl PECERR_R {
#[inline(always)]
pub const fn variant(&self) -> PECERRR {
match self.bits {
false => PECERRR::NoError,
true => PECERRR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == PECERRR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == PECERRR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PECERRW {
Clear = 0,
}
impl From<PECERRW> for bool {
#[inline(always)]
fn from(variant: PECERRW) -> Self {
variant as u8 != 0
}
}
pub type PECERR_W<'a, REG> = crate::BitWriter0C<'a, REG, PECERRW>;
impl<'a, REG> PECERR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(PECERRW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIMEOUTR {
NoTimeout = 0,
Timeout = 1,
}
impl From<TIMEOUTR> for bool {
#[inline(always)]
fn from(variant: TIMEOUTR) -> Self {
variant as u8 != 0
}
}
pub type TIMEOUT_R = crate::BitReader<TIMEOUTR>;
impl TIMEOUT_R {
#[inline(always)]
pub const fn variant(&self) -> TIMEOUTR {
match self.bits {
false => TIMEOUTR::NoTimeout,
true => TIMEOUTR::Timeout,
}
}
#[inline(always)]
pub fn is_no_timeout(&self) -> bool {
*self == TIMEOUTR::NoTimeout
}
#[inline(always)]
pub fn is_timeout(&self) -> bool {
*self == TIMEOUTR::Timeout
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIMEOUTW {
Clear = 0,
}
impl From<TIMEOUTW> for bool {
#[inline(always)]
fn from(variant: TIMEOUTW) -> Self {
variant as u8 != 0
}
}
pub type TIMEOUT_W<'a, REG> = crate::BitWriter0C<'a, REG, TIMEOUTW>;
impl<'a, REG> TIMEOUT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(TIMEOUTW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SMBALERTR {
NoAlert = 0,
Alert = 1,
}
impl From<SMBALERTR> for bool {
#[inline(always)]
fn from(variant: SMBALERTR) -> Self {
variant as u8 != 0
}
}
pub type SMBALERT_R = crate::BitReader<SMBALERTR>;
impl SMBALERT_R {
#[inline(always)]
pub const fn variant(&self) -> SMBALERTR {
match self.bits {
false => SMBALERTR::NoAlert,
true => SMBALERTR::Alert,
}
}
#[inline(always)]
pub fn is_no_alert(&self) -> bool {
*self == SMBALERTR::NoAlert
}
#[inline(always)]
pub fn is_alert(&self) -> bool {
*self == SMBALERTR::Alert
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SMBALERTW {
Clear = 0,
}
impl From<SMBALERTW> for bool {
#[inline(always)]
fn from(variant: SMBALERTW) -> Self {
variant as u8 != 0
}
}
pub type SMBALERT_W<'a, REG> = crate::BitWriter0C<'a, REG, SMBALERTW>;
impl<'a, REG> SMBALERT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(SMBALERTW::Clear)
}
}
impl R {
#[inline(always)]
pub fn sb(&self) -> SB_R {
SB_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn addr(&self) -> ADDR_R {
ADDR_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn btf(&self) -> BTF_R {
BTF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn add10(&self) -> ADD10_R {
ADD10_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn stopf(&self) -> STOPF_R {
STOPF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn rx_ne(&self) -> RX_NE_R {
RX_NE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn tx_e(&self) -> TX_E_R {
TX_E_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn berr(&self) -> BERR_R {
BERR_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn arlo(&self) -> ARLO_R {
ARLO_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn af(&self) -> AF_R {
AF_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn ovr(&self) -> OVR_R {
OVR_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn pecerr(&self) -> PECERR_R {
PECERR_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn timeout(&self) -> TIMEOUT_R {
TIMEOUT_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn smbalert(&self) -> SMBALERT_R {
SMBALERT_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR1")
.field("smbalert", &self.smbalert())
.field("timeout", &self.timeout())
.field("pecerr", &self.pecerr())
.field("ovr", &self.ovr())
.field("af", &self.af())
.field("arlo", &self.arlo())
.field("berr", &self.berr())
.field("tx_e", &self.tx_e())
.field("rx_ne", &self.rx_ne())
.field("stopf", &self.stopf())
.field("add10", &self.add10())
.field("btf", &self.btf())
.field("addr", &self.addr())
.field("sb", &self.sb())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn berr(&mut self) -> BERR_W<SR1rs> {
BERR_W::new(self, 8)
}
#[inline(always)]
#[must_use]
pub fn arlo(&mut self) -> ARLO_W<SR1rs> {
ARLO_W::new(self, 9)
}
#[inline(always)]
#[must_use]
pub fn af(&mut self) -> AF_W<SR1rs> {
AF_W::new(self, 10)
}
#[inline(always)]
#[must_use]
pub fn ovr(&mut self) -> OVR_W<SR1rs> {
OVR_W::new(self, 11)
}
#[inline(always)]
#[must_use]
pub fn pecerr(&mut self) -> PECERR_W<SR1rs> {
PECERR_W::new(self, 12)
}
#[inline(always)]
#[must_use]
pub fn timeout(&mut self) -> TIMEOUT_W<SR1rs> {
TIMEOUT_W::new(self, 14)
}
#[inline(always)]
#[must_use]
pub fn smbalert(&mut self) -> SMBALERT_W<SR1rs> {
SMBALERT_W::new(self, 15)
}
}
pub struct SR1rs;
impl crate::RegisterSpec for SR1rs {
type Ux = u32;
}
impl crate::Readable for SR1rs {}
impl crate::Writable for SR1rs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0xdf00;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for SR1rs {
const RESET_VALUE: u32 = 0;
}