pub type R = crate::R<ISRrs>;
pub type W = crate::W<ISRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXER {
NotEmpty = 0,
Empty = 1,
}
impl From<TXER> for bool {
#[inline(always)]
fn from(variant: TXER) -> Self {
variant as u8 != 0
}
}
pub type TXE_R = crate::BitReader<TXER>;
impl TXE_R {
#[inline(always)]
pub const fn variant(&self) -> TXER {
match self.bits {
false => TXER::NotEmpty,
true => TXER::Empty,
}
}
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
*self == TXER::NotEmpty
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == TXER::Empty
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXEW {
Flush = 1,
}
impl From<TXEW> for bool {
#[inline(always)]
fn from(variant: TXEW) -> Self {
variant as u8 != 0
}
}
pub type TXE_W<'a, REG> = crate::BitWriter1S<'a, REG, TXEW>;
impl<'a, REG> TXE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn flush(self) -> &'a mut crate::W<REG> {
self.variant(TXEW::Flush)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXISR {
NotEmpty = 0,
Empty = 1,
}
impl From<TXISR> for bool {
#[inline(always)]
fn from(variant: TXISR) -> Self {
variant as u8 != 0
}
}
pub type TXIS_R = crate::BitReader<TXISR>;
impl TXIS_R {
#[inline(always)]
pub const fn variant(&self) -> TXISR {
match self.bits {
false => TXISR::NotEmpty,
true => TXISR::Empty,
}
}
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
*self == TXISR::NotEmpty
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == TXISR::Empty
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXISW {
Trigger = 1,
}
impl From<TXISW> for bool {
#[inline(always)]
fn from(variant: TXISW) -> Self {
variant as u8 != 0
}
}
pub type TXIS_W<'a, REG> = crate::BitWriter1S<'a, REG, TXISW>;
impl<'a, REG> TXIS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn trigger(self) -> &'a mut crate::W<REG> {
self.variant(TXISW::Trigger)
}
}
#[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 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 NACKF {
NoNack = 0,
Nack = 1,
}
impl From<NACKF> for bool {
#[inline(always)]
fn from(variant: NACKF) -> Self {
variant as u8 != 0
}
}
pub type NACKF_R = crate::BitReader<NACKF>;
impl NACKF_R {
#[inline(always)]
pub const fn variant(&self) -> NACKF {
match self.bits {
false => NACKF::NoNack,
true => NACKF::Nack,
}
}
#[inline(always)]
pub fn is_no_nack(&self) -> bool {
*self == NACKF::NoNack
}
#[inline(always)]
pub fn is_nack(&self) -> bool {
*self == NACKF::Nack
}
}
#[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 TC {
NotComplete = 0,
Complete = 1,
}
impl From<TC> for bool {
#[inline(always)]
fn from(variant: TC) -> Self {
variant as u8 != 0
}
}
pub type TC_R = crate::BitReader<TC>;
impl TC_R {
#[inline(always)]
pub const fn variant(&self) -> TC {
match self.bits {
false => TC::NotComplete,
true => TC::Complete,
}
}
#[inline(always)]
pub fn is_not_complete(&self) -> bool {
*self == TC::NotComplete
}
#[inline(always)]
pub fn is_complete(&self) -> bool {
*self == TC::Complete
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCR {
NotComplete = 0,
Complete = 1,
}
impl From<TCR> for bool {
#[inline(always)]
fn from(variant: TCR) -> Self {
variant as u8 != 0
}
}
pub type TCR_R = crate::BitReader<TCR>;
impl TCR_R {
#[inline(always)]
pub const fn variant(&self) -> TCR {
match self.bits {
false => TCR::NotComplete,
true => TCR::Complete,
}
}
#[inline(always)]
pub fn is_not_complete(&self) -> bool {
*self == TCR::NotComplete
}
#[inline(always)]
pub fn is_complete(&self) -> bool {
*self == TCR::Complete
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BERR {
NoError = 0,
Error = 1,
}
impl From<BERR> for bool {
#[inline(always)]
fn from(variant: BERR) -> Self {
variant as u8 != 0
}
}
pub type BERR_R = crate::BitReader<BERR>;
impl BERR_R {
#[inline(always)]
pub const fn variant(&self) -> BERR {
match self.bits {
false => BERR::NoError,
true => BERR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == BERR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == BERR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ARLO {
NotLost = 0,
Lost = 1,
}
impl From<ARLO> for bool {
#[inline(always)]
fn from(variant: ARLO) -> Self {
variant as u8 != 0
}
}
pub type ARLO_R = crate::BitReader<ARLO>;
impl ARLO_R {
#[inline(always)]
pub const fn variant(&self) -> ARLO {
match self.bits {
false => ARLO::NotLost,
true => ARLO::Lost,
}
}
#[inline(always)]
pub fn is_not_lost(&self) -> bool {
*self == ARLO::NotLost
}
#[inline(always)]
pub fn is_lost(&self) -> bool {
*self == ARLO::Lost
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OVR {
NoOverrun = 0,
Overrun = 1,
}
impl From<OVR> for bool {
#[inline(always)]
fn from(variant: OVR) -> Self {
variant as u8 != 0
}
}
pub type OVR_R = crate::BitReader<OVR>;
impl OVR_R {
#[inline(always)]
pub const fn variant(&self) -> OVR {
match self.bits {
false => OVR::NoOverrun,
true => OVR::Overrun,
}
}
#[inline(always)]
pub fn is_no_overrun(&self) -> bool {
*self == OVR::NoOverrun
}
#[inline(always)]
pub fn is_overrun(&self) -> bool {
*self == OVR::Overrun
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PECERR {
Match = 0,
NoMatch = 1,
}
impl From<PECERR> for bool {
#[inline(always)]
fn from(variant: PECERR) -> Self {
variant as u8 != 0
}
}
pub type PECERR_R = crate::BitReader<PECERR>;
impl PECERR_R {
#[inline(always)]
pub const fn variant(&self) -> PECERR {
match self.bits {
false => PECERR::Match,
true => PECERR::NoMatch,
}
}
#[inline(always)]
pub fn is_match(&self) -> bool {
*self == PECERR::Match
}
#[inline(always)]
pub fn is_no_match(&self) -> bool {
*self == PECERR::NoMatch
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIMEOUT {
NoTimeout = 0,
Timeout = 1,
}
impl From<TIMEOUT> for bool {
#[inline(always)]
fn from(variant: TIMEOUT) -> Self {
variant as u8 != 0
}
}
pub type TIMEOUT_R = crate::BitReader<TIMEOUT>;
impl TIMEOUT_R {
#[inline(always)]
pub const fn variant(&self) -> TIMEOUT {
match self.bits {
false => TIMEOUT::NoTimeout,
true => TIMEOUT::Timeout,
}
}
#[inline(always)]
pub fn is_no_timeout(&self) -> bool {
*self == TIMEOUT::NoTimeout
}
#[inline(always)]
pub fn is_timeout(&self) -> bool {
*self == TIMEOUT::Timeout
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALERT {
NoAlert = 0,
Alert = 1,
}
impl From<ALERT> for bool {
#[inline(always)]
fn from(variant: ALERT) -> Self {
variant as u8 != 0
}
}
pub type ALERT_R = crate::BitReader<ALERT>;
impl ALERT_R {
#[inline(always)]
pub const fn variant(&self) -> ALERT {
match self.bits {
false => ALERT::NoAlert,
true => ALERT::Alert,
}
}
#[inline(always)]
pub fn is_no_alert(&self) -> bool {
*self == ALERT::NoAlert
}
#[inline(always)]
pub fn is_alert(&self) -> bool {
*self == ALERT::Alert
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BUSY {
NotBusy = 0,
Busy = 1,
}
impl From<BUSY> for bool {
#[inline(always)]
fn from(variant: BUSY) -> Self {
variant as u8 != 0
}
}
pub type BUSY_R = crate::BitReader<BUSY>;
impl BUSY_R {
#[inline(always)]
pub const fn variant(&self) -> BUSY {
match self.bits {
false => BUSY::NotBusy,
true => BUSY::Busy,
}
}
#[inline(always)]
pub fn is_not_busy(&self) -> bool {
*self == BUSY::NotBusy
}
#[inline(always)]
pub fn is_busy(&self) -> bool {
*self == BUSY::Busy
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DIR {
Write = 0,
Read = 1,
}
impl From<DIR> for bool {
#[inline(always)]
fn from(variant: DIR) -> Self {
variant as u8 != 0
}
}
pub type DIR_R = crate::BitReader<DIR>;
impl DIR_R {
#[inline(always)]
pub const fn variant(&self) -> DIR {
match self.bits {
false => DIR::Write,
true => DIR::Read,
}
}
#[inline(always)]
pub fn is_write(&self) -> bool {
*self == DIR::Write
}
#[inline(always)]
pub fn is_read(&self) -> bool {
*self == DIR::Read
}
}
pub type ADDCODE_R = crate::FieldReader;
impl R {
#[inline(always)]
pub fn txe(&self) -> TXE_R {
TXE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn txis(&self) -> TXIS_R {
TXIS_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn rxne(&self) -> RXNE_R {
RXNE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn addr(&self) -> ADDR_R {
ADDR_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn nackf(&self) -> NACKF_R {
NACKF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn stopf(&self) -> STOPF_R {
STOPF_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn tc(&self) -> TC_R {
TC_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn tcr(&self) -> TCR_R {
TCR_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 ovr(&self) -> OVR_R {
OVR_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn pecerr(&self) -> PECERR_R {
PECERR_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn timeout(&self) -> TIMEOUT_R {
TIMEOUT_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn alert(&self) -> ALERT_R {
ALERT_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn busy(&self) -> BUSY_R {
BUSY_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn dir(&self) -> DIR_R {
DIR_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn addcode(&self) -> ADDCODE_R {
ADDCODE_R::new(((self.bits >> 17) & 0x7f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ISR")
.field("addcode", &self.addcode())
.field("dir", &self.dir())
.field("busy", &self.busy())
.field("alert", &self.alert())
.field("timeout", &self.timeout())
.field("pecerr", &self.pecerr())
.field("ovr", &self.ovr())
.field("arlo", &self.arlo())
.field("berr", &self.berr())
.field("tcr", &self.tcr())
.field("tc", &self.tc())
.field("stopf", &self.stopf())
.field("nackf", &self.nackf())
.field("addr", &self.addr())
.field("rxne", &self.rxne())
.field("txis", &self.txis())
.field("txe", &self.txe())
.finish()
}
}
impl W {
#[inline(always)]
pub fn txe(&mut self) -> TXE_W<ISRrs> {
TXE_W::new(self, 0)
}
#[inline(always)]
pub fn txis(&mut self) -> TXIS_W<ISRrs> {
TXIS_W::new(self, 1)
}
}
pub struct ISRrs;
impl crate::RegisterSpec for ISRrs {
type Ux = u32;
}
impl crate::Readable for ISRrs {}
impl crate::Writable for ISRrs {
type Safety = crate::Unsafe;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x03;
}
impl crate::Resettable for ISRrs {
const RESET_VALUE: u32 = 0x01;
}