pub type R = crate::R<SRrs>;
pub type W = crate::W<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PE {
NoError = 0,
Error = 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::NoError,
true => PE::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == PE::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == PE::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FE {
NoError = 0,
Error = 1,
}
impl From<FE> for bool {
#[inline(always)]
fn from(variant: FE) -> Self {
variant as u8 != 0
}
}
pub type FE_R = crate::BitReader<FE>;
impl FE_R {
#[inline(always)]
pub const fn variant(&self) -> FE {
match self.bits {
false => FE::NoError,
true => FE::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == FE::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == FE::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NF {
NoNoise = 0,
Noise = 1,
}
impl From<NF> for bool {
#[inline(always)]
fn from(variant: NF) -> Self {
variant as u8 != 0
}
}
pub type NF_R = crate::BitReader<NF>;
impl NF_R {
#[inline(always)]
pub const fn variant(&self) -> NF {
match self.bits {
false => NF::NoNoise,
true => NF::Noise,
}
}
#[inline(always)]
pub fn is_no_noise(&self) -> bool {
*self == NF::NoNoise
}
#[inline(always)]
pub fn is_noise(&self) -> bool {
*self == NF::Noise
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ORE {
NoOverrun = 0,
Overrun = 1,
}
impl From<ORE> for bool {
#[inline(always)]
fn from(variant: ORE) -> Self {
variant as u8 != 0
}
}
pub type ORE_R = crate::BitReader<ORE>;
impl ORE_R {
#[inline(always)]
pub const fn variant(&self) -> ORE {
match self.bits {
false => ORE::NoOverrun,
true => ORE::Overrun,
}
}
#[inline(always)]
pub fn is_no_overrun(&self) -> bool {
*self == ORE::NoOverrun
}
#[inline(always)]
pub fn is_overrun(&self) -> bool {
*self == ORE::Overrun
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IDLE {
NoIdle = 0,
Idle = 1,
}
impl From<IDLE> for bool {
#[inline(always)]
fn from(variant: IDLE) -> Self {
variant as u8 != 0
}
}
pub type IDLE_R = crate::BitReader<IDLE>;
impl IDLE_R {
#[inline(always)]
pub const fn variant(&self) -> IDLE {
match self.bits {
false => IDLE::NoIdle,
true => IDLE::Idle,
}
}
#[inline(always)]
pub fn is_no_idle(&self) -> bool {
*self == IDLE::NoIdle
}
#[inline(always)]
pub fn is_idle(&self) -> bool {
*self == IDLE::Idle
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXNER {
NoData = 0,
DataReady = 1,
}
impl From<RXNER> for bool {
#[inline(always)]
fn from(variant: RXNER) -> Self {
variant as u8 != 0
}
}
pub type RXNE_R = crate::BitReader<RXNER>;
impl RXNE_R {
#[inline(always)]
pub const fn variant(&self) -> RXNER {
match self.bits {
false => RXNER::NoData,
true => RXNER::DataReady,
}
}
#[inline(always)]
pub fn is_no_data(&self) -> bool {
*self == RXNER::NoData
}
#[inline(always)]
pub fn is_data_ready(&self) -> bool {
*self == RXNER::DataReady
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXNEW {
Clear = 0,
}
impl From<RXNEW> for bool {
#[inline(always)]
fn from(variant: RXNEW) -> Self {
variant as u8 != 0
}
}
pub type RXNE_W<'a, REG> = crate::BitWriter0C<'a, REG, RXNEW>;
impl<'a, REG> RXNE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(RXNEW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCR {
TxNotComplete = 0,
TxComplete = 1,
}
impl From<TCR> for bool {
#[inline(always)]
fn from(variant: TCR) -> Self {
variant as u8 != 0
}
}
pub type TC_R = crate::BitReader<TCR>;
impl TC_R {
#[inline(always)]
pub const fn variant(&self) -> TCR {
match self.bits {
false => TCR::TxNotComplete,
true => TCR::TxComplete,
}
}
#[inline(always)]
pub fn is_tx_not_complete(&self) -> bool {
*self == TCR::TxNotComplete
}
#[inline(always)]
pub fn is_tx_complete(&self) -> bool {
*self == TCR::TxComplete
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCW {
Clear = 0,
}
impl From<TCW> for bool {
#[inline(always)]
fn from(variant: TCW) -> Self {
variant as u8 != 0
}
}
pub type TC_W<'a, REG> = crate::BitWriter0C<'a, REG, TCW>;
impl<'a, REG> TC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(TCW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXE {
TxNotEmpty = 0,
TxEmpty = 1,
}
impl From<TXE> for bool {
#[inline(always)]
fn from(variant: TXE) -> Self {
variant as u8 != 0
}
}
pub type TXE_R = crate::BitReader<TXE>;
impl TXE_R {
#[inline(always)]
pub const fn variant(&self) -> TXE {
match self.bits {
false => TXE::TxNotEmpty,
true => TXE::TxEmpty,
}
}
#[inline(always)]
pub fn is_tx_not_empty(&self) -> bool {
*self == TXE::TxNotEmpty
}
#[inline(always)]
pub fn is_tx_empty(&self) -> bool {
*self == TXE::TxEmpty
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LBDR {
NotDetected = 0,
Detected = 1,
}
impl From<LBDR> for bool {
#[inline(always)]
fn from(variant: LBDR) -> Self {
variant as u8 != 0
}
}
pub type LBD_R = crate::BitReader<LBDR>;
impl LBD_R {
#[inline(always)]
pub const fn variant(&self) -> LBDR {
match self.bits {
false => LBDR::NotDetected,
true => LBDR::Detected,
}
}
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == LBDR::NotDetected
}
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == LBDR::Detected
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LBDW {
Clear = 0,
}
impl From<LBDW> for bool {
#[inline(always)]
fn from(variant: LBDW) -> Self {
variant as u8 != 0
}
}
pub type LBD_W<'a, REG> = crate::BitWriter0C<'a, REG, LBDW>;
impl<'a, REG> LBD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(LBDW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CTSR {
NotChanged = 0,
Changed = 1,
}
impl From<CTSR> for bool {
#[inline(always)]
fn from(variant: CTSR) -> Self {
variant as u8 != 0
}
}
pub type CTS_R = crate::BitReader<CTSR>;
impl CTS_R {
#[inline(always)]
pub const fn variant(&self) -> CTSR {
match self.bits {
false => CTSR::NotChanged,
true => CTSR::Changed,
}
}
#[inline(always)]
pub fn is_not_changed(&self) -> bool {
*self == CTSR::NotChanged
}
#[inline(always)]
pub fn is_changed(&self) -> bool {
*self == CTSR::Changed
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CTSW {
Clear = 0,
}
impl From<CTSW> for bool {
#[inline(always)]
fn from(variant: CTSW) -> Self {
variant as u8 != 0
}
}
pub type CTS_W<'a, REG> = crate::BitWriter0C<'a, REG, CTSW>;
impl<'a, REG> CTS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CTSW::Clear)
}
}
impl R {
#[inline(always)]
pub fn pe(&self) -> PE_R {
PE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn fe(&self) -> FE_R {
FE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn nf(&self) -> NF_R {
NF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn ore(&self) -> ORE_R {
ORE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn idle(&self) -> IDLE_R {
IDLE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn rxne(&self) -> RXNE_R {
RXNE_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 txe(&self) -> TXE_R {
TXE_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn lbd(&self) -> LBD_R {
LBD_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn cts(&self) -> CTS_R {
CTS_R::new(((self.bits >> 9) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("cts", &self.cts())
.field("lbd", &self.lbd())
.field("txe", &self.txe())
.field("tc", &self.tc())
.field("rxne", &self.rxne())
.field("idle", &self.idle())
.field("ore", &self.ore())
.field("nf", &self.nf())
.field("fe", &self.fe())
.field("pe", &self.pe())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rxne(&mut self) -> RXNE_W<SRrs> {
RXNE_W::new(self, 5)
}
#[inline(always)]
pub fn tc(&mut self) -> TC_W<SRrs> {
TC_W::new(self, 6)
}
#[inline(always)]
pub fn lbd(&mut self) -> LBD_W<SRrs> {
LBD_W::new(self, 8)
}
#[inline(always)]
pub fn cts(&mut self) -> CTS_W<SRrs> {
CTS_W::new(self, 9)
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u16;
}
impl crate::Readable for SRrs {}
impl crate::Writable for SRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0x0360;
}
impl crate::Resettable for SRrs {
const RESET_VALUE: u16 = 0xc0;
}