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 SPE {
Disabled = 0,
Enabled = 1,
}
impl From<SPE> for bool {
#[inline(always)]
fn from(variant: SPE) -> Self {
variant as u8 != 0
}
}
pub type SPE_R = crate::BitReader<SPE>;
impl SPE_R {
#[inline(always)]
pub const fn variant(&self) -> SPE {
match self.bits {
false => SPE::Disabled,
true => SPE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SPE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SPE::Enabled
}
}
pub type SPE_W<'a, REG> = crate::BitWriter<'a, REG, SPE>;
impl<'a, REG> SPE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SPE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SPE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MASRX {
Disabled = 0,
Enabled = 1,
}
impl From<MASRX> for bool {
#[inline(always)]
fn from(variant: MASRX) -> Self {
variant as u8 != 0
}
}
pub type MASRX_R = crate::BitReader<MASRX>;
impl MASRX_R {
#[inline(always)]
pub const fn variant(&self) -> MASRX {
match self.bits {
false => MASRX::Disabled,
true => MASRX::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == MASRX::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == MASRX::Enabled
}
}
pub type MASRX_W<'a, REG> = crate::BitWriter<'a, REG, MASRX>;
impl<'a, REG> MASRX_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(MASRX::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(MASRX::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CSTART {
NotStarted = 0,
Started = 1,
}
impl From<CSTART> for bool {
#[inline(always)]
fn from(variant: CSTART) -> Self {
variant as u8 != 0
}
}
pub type CSTART_R = crate::BitReader<CSTART>;
impl CSTART_R {
#[inline(always)]
pub const fn variant(&self) -> CSTART {
match self.bits {
false => CSTART::NotStarted,
true => CSTART::Started,
}
}
#[inline(always)]
pub fn is_not_started(&self) -> bool {
*self == CSTART::NotStarted
}
#[inline(always)]
pub fn is_started(&self) -> bool {
*self == CSTART::Started
}
}
pub type CSTART_W<'a, REG> = crate::BitWriter<'a, REG, CSTART>;
impl<'a, REG> CSTART_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_started(self) -> &'a mut crate::W<REG> {
self.variant(CSTART::NotStarted)
}
#[inline(always)]
pub fn started(self) -> &'a mut crate::W<REG> {
self.variant(CSTART::Started)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CSUSPW {
NotRequested = 0,
Requested = 1,
}
impl From<CSUSPW> for bool {
#[inline(always)]
fn from(variant: CSUSPW) -> Self {
variant as u8 != 0
}
}
pub type CSUSP_W<'a, REG> = crate::BitWriter<'a, REG, CSUSPW>;
impl<'a, REG> CSUSP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_requested(self) -> &'a mut crate::W<REG> {
self.variant(CSUSPW::NotRequested)
}
#[inline(always)]
pub fn requested(self) -> &'a mut crate::W<REG> {
self.variant(CSUSPW::Requested)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HDDIR {
Receiver = 0,
Transmitter = 1,
}
impl From<HDDIR> for bool {
#[inline(always)]
fn from(variant: HDDIR) -> Self {
variant as u8 != 0
}
}
pub type HDDIR_R = crate::BitReader<HDDIR>;
impl HDDIR_R {
#[inline(always)]
pub const fn variant(&self) -> HDDIR {
match self.bits {
false => HDDIR::Receiver,
true => HDDIR::Transmitter,
}
}
#[inline(always)]
pub fn is_receiver(&self) -> bool {
*self == HDDIR::Receiver
}
#[inline(always)]
pub fn is_transmitter(&self) -> bool {
*self == HDDIR::Transmitter
}
}
pub type HDDIR_W<'a, REG> = crate::BitWriter<'a, REG, HDDIR>;
impl<'a, REG> HDDIR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn receiver(self) -> &'a mut crate::W<REG> {
self.variant(HDDIR::Receiver)
}
#[inline(always)]
pub fn transmitter(self) -> &'a mut crate::W<REG> {
self.variant(HDDIR::Transmitter)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SSI {
SlaveSelected = 0,
SlaveNotSelected = 1,
}
impl From<SSI> for bool {
#[inline(always)]
fn from(variant: SSI) -> Self {
variant as u8 != 0
}
}
pub type SSI_R = crate::BitReader<SSI>;
impl SSI_R {
#[inline(always)]
pub const fn variant(&self) -> SSI {
match self.bits {
false => SSI::SlaveSelected,
true => SSI::SlaveNotSelected,
}
}
#[inline(always)]
pub fn is_slave_selected(&self) -> bool {
*self == SSI::SlaveSelected
}
#[inline(always)]
pub fn is_slave_not_selected(&self) -> bool {
*self == SSI::SlaveNotSelected
}
}
pub type SSI_W<'a, REG> = crate::BitWriter<'a, REG, SSI>;
impl<'a, REG> SSI_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn slave_selected(self) -> &'a mut crate::W<REG> {
self.variant(SSI::SlaveSelected)
}
#[inline(always)]
pub fn slave_not_selected(self) -> &'a mut crate::W<REG> {
self.variant(SSI::SlaveNotSelected)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CRC33_17 {
Disabled = 0,
Enabled = 1,
}
impl From<CRC33_17> for bool {
#[inline(always)]
fn from(variant: CRC33_17) -> Self {
variant as u8 != 0
}
}
pub type CRC33_17_R = crate::BitReader<CRC33_17>;
impl CRC33_17_R {
#[inline(always)]
pub const fn variant(&self) -> CRC33_17 {
match self.bits {
false => CRC33_17::Disabled,
true => CRC33_17::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CRC33_17::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CRC33_17::Enabled
}
}
pub type CRC33_17_W<'a, REG> = crate::BitWriter<'a, REG, CRC33_17>;
impl<'a, REG> CRC33_17_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CRC33_17::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CRC33_17::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RCRCINI {
AllZeros = 0,
AllOnes = 1,
}
impl From<RCRCINI> for bool {
#[inline(always)]
fn from(variant: RCRCINI) -> Self {
variant as u8 != 0
}
}
pub type RCRCINI_R = crate::BitReader<RCRCINI>;
impl RCRCINI_R {
#[inline(always)]
pub const fn variant(&self) -> RCRCINI {
match self.bits {
false => RCRCINI::AllZeros,
true => RCRCINI::AllOnes,
}
}
#[inline(always)]
pub fn is_all_zeros(&self) -> bool {
*self == RCRCINI::AllZeros
}
#[inline(always)]
pub fn is_all_ones(&self) -> bool {
*self == RCRCINI::AllOnes
}
}
pub type RCRCINI_W<'a, REG> = crate::BitWriter<'a, REG, RCRCINI>;
impl<'a, REG> RCRCINI_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn all_zeros(self) -> &'a mut crate::W<REG> {
self.variant(RCRCINI::AllZeros)
}
#[inline(always)]
pub fn all_ones(self) -> &'a mut crate::W<REG> {
self.variant(RCRCINI::AllOnes)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCRCINI {
AllZeros = 0,
AllOnes = 1,
}
impl From<TCRCINI> for bool {
#[inline(always)]
fn from(variant: TCRCINI) -> Self {
variant as u8 != 0
}
}
pub type TCRCINI_R = crate::BitReader<TCRCINI>;
impl TCRCINI_R {
#[inline(always)]
pub const fn variant(&self) -> TCRCINI {
match self.bits {
false => TCRCINI::AllZeros,
true => TCRCINI::AllOnes,
}
}
#[inline(always)]
pub fn is_all_zeros(&self) -> bool {
*self == TCRCINI::AllZeros
}
#[inline(always)]
pub fn is_all_ones(&self) -> bool {
*self == TCRCINI::AllOnes
}
}
pub type TCRCINI_W<'a, REG> = crate::BitWriter<'a, REG, TCRCINI>;
impl<'a, REG> TCRCINI_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn all_zeros(self) -> &'a mut crate::W<REG> {
self.variant(TCRCINI::AllZeros)
}
#[inline(always)]
pub fn all_ones(self) -> &'a mut crate::W<REG> {
self.variant(TCRCINI::AllOnes)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IOLOCK {
Unlocked = 0,
Locked = 1,
}
impl From<IOLOCK> for bool {
#[inline(always)]
fn from(variant: IOLOCK) -> Self {
variant as u8 != 0
}
}
pub type IOLOCK_R = crate::BitReader<IOLOCK>;
impl IOLOCK_R {
#[inline(always)]
pub const fn variant(&self) -> IOLOCK {
match self.bits {
false => IOLOCK::Unlocked,
true => IOLOCK::Locked,
}
}
#[inline(always)]
pub fn is_unlocked(&self) -> bool {
*self == IOLOCK::Unlocked
}
#[inline(always)]
pub fn is_locked(&self) -> bool {
*self == IOLOCK::Locked
}
}
pub type IOLOCK_W<'a, REG> = crate::BitWriter<'a, REG, IOLOCK>;
impl<'a, REG> IOLOCK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn unlocked(self) -> &'a mut crate::W<REG> {
self.variant(IOLOCK::Unlocked)
}
#[inline(always)]
pub fn locked(self) -> &'a mut crate::W<REG> {
self.variant(IOLOCK::Locked)
}
}
impl R {
#[inline(always)]
pub fn spe(&self) -> SPE_R {
SPE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn masrx(&self) -> MASRX_R {
MASRX_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn cstart(&self) -> CSTART_R {
CSTART_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn hddir(&self) -> HDDIR_R {
HDDIR_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn ssi(&self) -> SSI_R {
SSI_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn crc33_17(&self) -> CRC33_17_R {
CRC33_17_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn rcrcini(&self) -> RCRCINI_R {
RCRCINI_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn tcrcini(&self) -> TCRCINI_R {
TCRCINI_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn iolock(&self) -> IOLOCK_R {
IOLOCK_R::new(((self.bits >> 16) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR1")
.field("iolock", &self.iolock())
.field("tcrcini", &self.tcrcini())
.field("rcrcini", &self.rcrcini())
.field("crc33_17", &self.crc33_17())
.field("ssi", &self.ssi())
.field("hddir", &self.hddir())
.field("cstart", &self.cstart())
.field("masrx", &self.masrx())
.field("spe", &self.spe())
.finish()
}
}
impl W {
#[inline(always)]
pub fn spe(&mut self) -> SPE_W<CR1rs> {
SPE_W::new(self, 0)
}
#[inline(always)]
pub fn masrx(&mut self) -> MASRX_W<CR1rs> {
MASRX_W::new(self, 8)
}
#[inline(always)]
pub fn cstart(&mut self) -> CSTART_W<CR1rs> {
CSTART_W::new(self, 9)
}
#[inline(always)]
pub fn csusp(&mut self) -> CSUSP_W<CR1rs> {
CSUSP_W::new(self, 10)
}
#[inline(always)]
pub fn hddir(&mut self) -> HDDIR_W<CR1rs> {
HDDIR_W::new(self, 11)
}
#[inline(always)]
pub fn ssi(&mut self) -> SSI_W<CR1rs> {
SSI_W::new(self, 12)
}
#[inline(always)]
pub fn crc33_17(&mut self) -> CRC33_17_W<CR1rs> {
CRC33_17_W::new(self, 13)
}
#[inline(always)]
pub fn rcrcini(&mut self) -> RCRCINI_W<CR1rs> {
RCRCINI_W::new(self, 14)
}
#[inline(always)]
pub fn tcrcini(&mut self) -> TCRCINI_W<CR1rs> {
TCRCINI_W::new(self, 15)
}
#[inline(always)]
pub fn iolock(&mut self) -> IOLOCK_W<CR1rs> {
IOLOCK_W::new(self, 16)
}
}
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;
}
impl crate::Resettable for CR1rs {}