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 SBK {
NoBreak = 0,
Break = 1,
}
impl From<SBK> for bool {
#[inline(always)]
fn from(variant: SBK) -> Self {
variant as u8 != 0
}
}
pub type SBK_R = crate::BitReader<SBK>;
impl SBK_R {
#[inline(always)]
pub const fn variant(&self) -> SBK {
match self.bits {
false => SBK::NoBreak,
true => SBK::Break,
}
}
#[inline(always)]
pub fn is_no_break(&self) -> bool {
*self == SBK::NoBreak
}
#[inline(always)]
pub fn is_break(&self) -> bool {
*self == SBK::Break
}
}
pub type SBK_W<'a, REG> = crate::BitWriter<'a, REG, SBK>;
impl<'a, REG> SBK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_break(self) -> &'a mut crate::W<REG> {
self.variant(SBK::NoBreak)
}
#[inline(always)]
pub fn break_(self) -> &'a mut crate::W<REG> {
self.variant(SBK::Break)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RWU {
Active = 0,
Mute = 1,
}
impl From<RWU> for bool {
#[inline(always)]
fn from(variant: RWU) -> Self {
variant as u8 != 0
}
}
pub type RWU_R = crate::BitReader<RWU>;
impl RWU_R {
#[inline(always)]
pub const fn variant(&self) -> RWU {
match self.bits {
false => RWU::Active,
true => RWU::Mute,
}
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == RWU::Active
}
#[inline(always)]
pub fn is_mute(&self) -> bool {
*self == RWU::Mute
}
}
pub type RWU_W<'a, REG> = crate::BitWriter<'a, REG, RWU>;
impl<'a, REG> RWU_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active(self) -> &'a mut crate::W<REG> {
self.variant(RWU::Active)
}
#[inline(always)]
pub fn mute(self) -> &'a mut crate::W<REG> {
self.variant(RWU::Mute)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RE {
Disabled = 0,
Enabled = 1,
}
impl From<RE> for bool {
#[inline(always)]
fn from(variant: RE) -> Self {
variant as u8 != 0
}
}
pub type RE_R = crate::BitReader<RE>;
impl RE_R {
#[inline(always)]
pub const fn variant(&self) -> RE {
match self.bits {
false => RE::Disabled,
true => RE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RE::Enabled
}
}
pub type RE_W<'a, REG> = crate::BitWriter<'a, REG, RE>;
impl<'a, REG> RE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TE {
Disabled = 0,
Enabled = 1,
}
impl From<TE> for bool {
#[inline(always)]
fn from(variant: TE) -> Self {
variant as u8 != 0
}
}
pub type TE_R = crate::BitReader<TE>;
impl TE_R {
#[inline(always)]
pub const fn variant(&self) -> TE {
match self.bits {
false => TE::Disabled,
true => TE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TE::Enabled
}
}
pub type TE_W<'a, REG> = crate::BitWriter<'a, REG, TE>;
impl<'a, REG> TE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IDLEIE {
Disabled = 0,
Enabled = 1,
}
impl From<IDLEIE> for bool {
#[inline(always)]
fn from(variant: IDLEIE) -> Self {
variant as u8 != 0
}
}
pub type IDLEIE_R = crate::BitReader<IDLEIE>;
impl IDLEIE_R {
#[inline(always)]
pub const fn variant(&self) -> IDLEIE {
match self.bits {
false => IDLEIE::Disabled,
true => IDLEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == IDLEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == IDLEIE::Enabled
}
}
pub type IDLEIE_W<'a, REG> = crate::BitWriter<'a, REG, IDLEIE>;
impl<'a, REG> IDLEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(IDLEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(IDLEIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXNEIE {
Disabled = 0,
Enabled = 1,
}
impl From<RXNEIE> for bool {
#[inline(always)]
fn from(variant: RXNEIE) -> Self {
variant as u8 != 0
}
}
pub type RXNEIE_R = crate::BitReader<RXNEIE>;
impl RXNEIE_R {
#[inline(always)]
pub const fn variant(&self) -> RXNEIE {
match self.bits {
false => RXNEIE::Disabled,
true => RXNEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RXNEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RXNEIE::Enabled
}
}
pub type RXNEIE_W<'a, REG> = crate::BitWriter<'a, REG, RXNEIE>;
impl<'a, REG> RXNEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RXNEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RXNEIE::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 TXEIE {
Disabled = 0,
Enabled = 1,
}
impl From<TXEIE> for bool {
#[inline(always)]
fn from(variant: TXEIE) -> Self {
variant as u8 != 0
}
}
pub type TXEIE_R = crate::BitReader<TXEIE>;
impl TXEIE_R {
#[inline(always)]
pub const fn variant(&self) -> TXEIE {
match self.bits {
false => TXEIE::Disabled,
true => TXEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TXEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TXEIE::Enabled
}
}
pub type TXEIE_W<'a, REG> = crate::BitWriter<'a, REG, TXEIE>;
impl<'a, REG> TXEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TXEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TXEIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PEIE {
Disabled = 0,
Enabled = 1,
}
impl From<PEIE> for bool {
#[inline(always)]
fn from(variant: PEIE) -> Self {
variant as u8 != 0
}
}
pub type PEIE_R = crate::BitReader<PEIE>;
impl PEIE_R {
#[inline(always)]
pub const fn variant(&self) -> PEIE {
match self.bits {
false => PEIE::Disabled,
true => PEIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PEIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PEIE::Enabled
}
}
pub type PEIE_W<'a, REG> = crate::BitWriter<'a, REG, PEIE>;
impl<'a, REG> PEIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PEIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PEIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PS {
Even = 0,
Odd = 1,
}
impl From<PS> for bool {
#[inline(always)]
fn from(variant: PS) -> Self {
variant as u8 != 0
}
}
pub type PS_R = crate::BitReader<PS>;
impl PS_R {
#[inline(always)]
pub const fn variant(&self) -> PS {
match self.bits {
false => PS::Even,
true => PS::Odd,
}
}
#[inline(always)]
pub fn is_even(&self) -> bool {
*self == PS::Even
}
#[inline(always)]
pub fn is_odd(&self) -> bool {
*self == PS::Odd
}
}
pub type PS_W<'a, REG> = crate::BitWriter<'a, REG, PS>;
impl<'a, REG> PS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn even(self) -> &'a mut crate::W<REG> {
self.variant(PS::Even)
}
#[inline(always)]
pub fn odd(self) -> &'a mut crate::W<REG> {
self.variant(PS::Odd)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PCE {
Disabled = 0,
Enabled = 1,
}
impl From<PCE> for bool {
#[inline(always)]
fn from(variant: PCE) -> Self {
variant as u8 != 0
}
}
pub type PCE_R = crate::BitReader<PCE>;
impl PCE_R {
#[inline(always)]
pub const fn variant(&self) -> PCE {
match self.bits {
false => PCE::Disabled,
true => PCE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PCE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PCE::Enabled
}
}
pub type PCE_W<'a, REG> = crate::BitWriter<'a, REG, PCE>;
impl<'a, REG> PCE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PCE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PCE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WAKE {
IdleLine = 0,
AddressMark = 1,
}
impl From<WAKE> for bool {
#[inline(always)]
fn from(variant: WAKE) -> Self {
variant as u8 != 0
}
}
pub type WAKE_R = crate::BitReader<WAKE>;
impl WAKE_R {
#[inline(always)]
pub const fn variant(&self) -> WAKE {
match self.bits {
false => WAKE::IdleLine,
true => WAKE::AddressMark,
}
}
#[inline(always)]
pub fn is_idle_line(&self) -> bool {
*self == WAKE::IdleLine
}
#[inline(always)]
pub fn is_address_mark(&self) -> bool {
*self == WAKE::AddressMark
}
}
pub type WAKE_W<'a, REG> = crate::BitWriter<'a, REG, WAKE>;
impl<'a, REG> WAKE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn idle_line(self) -> &'a mut crate::W<REG> {
self.variant(WAKE::IdleLine)
}
#[inline(always)]
pub fn address_mark(self) -> &'a mut crate::W<REG> {
self.variant(WAKE::AddressMark)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum M {
M8 = 0,
M9 = 1,
}
impl From<M> for bool {
#[inline(always)]
fn from(variant: M) -> Self {
variant as u8 != 0
}
}
pub type M_R = crate::BitReader<M>;
impl M_R {
#[inline(always)]
pub const fn variant(&self) -> M {
match self.bits {
false => M::M8,
true => M::M9,
}
}
#[inline(always)]
pub fn is_m8(&self) -> bool {
*self == M::M8
}
#[inline(always)]
pub fn is_m9(&self) -> bool {
*self == M::M9
}
}
pub type M_W<'a, REG> = crate::BitWriter<'a, REG, M>;
impl<'a, REG> M_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn m8(self) -> &'a mut crate::W<REG> {
self.variant(M::M8)
}
#[inline(always)]
pub fn m9(self) -> &'a mut crate::W<REG> {
self.variant(M::M9)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UE {
Disabled = 0,
Enabled = 1,
}
impl From<UE> for bool {
#[inline(always)]
fn from(variant: UE) -> Self {
variant as u8 != 0
}
}
pub type UE_R = crate::BitReader<UE>;
impl UE_R {
#[inline(always)]
pub const fn variant(&self) -> UE {
match self.bits {
false => UE::Disabled,
true => UE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == UE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == UE::Enabled
}
}
pub type UE_W<'a, REG> = crate::BitWriter<'a, REG, UE>;
impl<'a, REG> UE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(UE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(UE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn sbk(&self) -> SBK_R {
SBK_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn rwu(&self) -> RWU_R {
RWU_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn re(&self) -> RE_R {
RE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn te(&self) -> TE_R {
TE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn idleie(&self) -> IDLEIE_R {
IDLEIE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn rxneie(&self) -> RXNEIE_R {
RXNEIE_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 txeie(&self) -> TXEIE_R {
TXEIE_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn peie(&self) -> PEIE_R {
PEIE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ps(&self) -> PS_R {
PS_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn pce(&self) -> PCE_R {
PCE_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn wake(&self) -> WAKE_R {
WAKE_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn m(&self) -> M_R {
M_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn ue(&self) -> UE_R {
UE_R::new(((self.bits >> 13) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR1")
.field("sbk", &self.sbk())
.field("rwu", &self.rwu())
.field("re", &self.re())
.field("te", &self.te())
.field("idleie", &self.idleie())
.field("rxneie", &self.rxneie())
.field("tcie", &self.tcie())
.field("txeie", &self.txeie())
.field("peie", &self.peie())
.field("ps", &self.ps())
.field("pce", &self.pce())
.field("wake", &self.wake())
.field("m", &self.m())
.field("ue", &self.ue())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn sbk(&mut self) -> SBK_W<CR1rs> {
SBK_W::new(self, 0)
}
#[inline(always)]
#[must_use]
pub fn rwu(&mut self) -> RWU_W<CR1rs> {
RWU_W::new(self, 1)
}
#[inline(always)]
#[must_use]
pub fn re(&mut self) -> RE_W<CR1rs> {
RE_W::new(self, 2)
}
#[inline(always)]
#[must_use]
pub fn te(&mut self) -> TE_W<CR1rs> {
TE_W::new(self, 3)
}
#[inline(always)]
#[must_use]
pub fn idleie(&mut self) -> IDLEIE_W<CR1rs> {
IDLEIE_W::new(self, 4)
}
#[inline(always)]
#[must_use]
pub fn rxneie(&mut self) -> RXNEIE_W<CR1rs> {
RXNEIE_W::new(self, 5)
}
#[inline(always)]
#[must_use]
pub fn tcie(&mut self) -> TCIE_W<CR1rs> {
TCIE_W::new(self, 6)
}
#[inline(always)]
#[must_use]
pub fn txeie(&mut self) -> TXEIE_W<CR1rs> {
TXEIE_W::new(self, 7)
}
#[inline(always)]
#[must_use]
pub fn peie(&mut self) -> PEIE_W<CR1rs> {
PEIE_W::new(self, 8)
}
#[inline(always)]
#[must_use]
pub fn ps(&mut self) -> PS_W<CR1rs> {
PS_W::new(self, 9)
}
#[inline(always)]
#[must_use]
pub fn pce(&mut self) -> PCE_W<CR1rs> {
PCE_W::new(self, 10)
}
#[inline(always)]
#[must_use]
pub fn wake(&mut self) -> WAKE_W<CR1rs> {
WAKE_W::new(self, 11)
}
#[inline(always)]
#[must_use]
pub fn m(&mut self) -> M_W<CR1rs> {
M_W::new(self, 12)
}
#[inline(always)]
#[must_use]
pub fn ue(&mut self) -> UE_W<CR1rs> {
UE_W::new(self, 13)
}
}
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;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for CR1rs {
const RESET_VALUE: u32 = 0;
}