Initial commit

This commit is contained in:
Thomas Klaehn
2021-06-04 07:58:05 +02:00
commit 060cfea264
805 changed files with 204833 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
#[doc = "Register `CURRENTLOADCTRL` reader"]
pub struct R(crate::R<CURRENTLOADCTRL_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CURRENTLOADCTRL_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CURRENTLOADCTRL_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CURRENTLOADCTRL_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `CURRENTLOADCTRL` reader - Current value driven to the NFC Load Control"]
pub struct CURRENTLOADCTRL_R(crate::FieldReader<u8, u8>);
impl CURRENTLOADCTRL_R {
pub(crate) fn new(bits: u8) -> Self {
CURRENTLOADCTRL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CURRENTLOADCTRL_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl R {
#[doc = "Bits 0:5 - Current value driven to the NFC Load Control"]
#[inline(always)]
pub fn currentloadctrl(&self) -> CURRENTLOADCTRL_R {
CURRENTLOADCTRL_R::new((self.bits & 0x3f) as u8)
}
}
#[doc = "Current value driven to the NFC Load Control\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [currentloadctrl](index.html) module"]
pub struct CURRENTLOADCTRL_SPEC;
impl crate::RegisterSpec for CURRENTLOADCTRL_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [currentloadctrl::R](R) reader structure"]
impl crate::Readable for CURRENTLOADCTRL_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets CURRENTLOADCTRL to value 0"]
impl crate::Resettable for CURRENTLOADCTRL_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

204
src/nfct/errorstatus.rs Normal file
View File

@@ -0,0 +1,204 @@
#[doc = "Register `ERRORSTATUS` reader"]
pub struct R(crate::R<ERRORSTATUS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ERRORSTATUS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ERRORSTATUS_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ERRORSTATUS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `ERRORSTATUS` writer"]
pub struct W(crate::W<ERRORSTATUS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<ERRORSTATUS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<ERRORSTATUS_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<ERRORSTATUS_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `FRAMEDELAYTIMEOUT` reader - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"]
pub struct FRAMEDELAYTIMEOUT_R(crate::FieldReader<bool, bool>);
impl FRAMEDELAYTIMEOUT_R {
pub(crate) fn new(bits: bool) -> Self {
FRAMEDELAYTIMEOUT_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FRAMEDELAYTIMEOUT_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FRAMEDELAYTIMEOUT` writer - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"]
pub struct FRAMEDELAYTIMEOUT_W<'a> {
w: &'a mut W,
}
impl<'a> FRAMEDELAYTIMEOUT_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
#[doc = "Field `NFCFIELDTOOSTRONG` reader - Field level is too high at max load resistance"]
pub struct NFCFIELDTOOSTRONG_R(crate::FieldReader<bool, bool>);
impl NFCFIELDTOOSTRONG_R {
pub(crate) fn new(bits: bool) -> Self {
NFCFIELDTOOSTRONG_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCFIELDTOOSTRONG_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCFIELDTOOSTRONG` writer - Field level is too high at max load resistance"]
pub struct NFCFIELDTOOSTRONG_W<'a> {
w: &'a mut W,
}
impl<'a> NFCFIELDTOOSTRONG_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Field `NFCFIELDTOOWEAK` reader - Field level is too low at min load resistance"]
pub struct NFCFIELDTOOWEAK_R(crate::FieldReader<bool, bool>);
impl NFCFIELDTOOWEAK_R {
pub(crate) fn new(bits: bool) -> Self {
NFCFIELDTOOWEAK_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCFIELDTOOWEAK_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCFIELDTOOWEAK` writer - Field level is too low at min load resistance"]
pub struct NFCFIELDTOOWEAK_W<'a> {
w: &'a mut W,
}
impl<'a> NFCFIELDTOOWEAK_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
self.w
}
}
impl R {
#[doc = "Bit 0 - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"]
#[inline(always)]
pub fn framedelaytimeout(&self) -> FRAMEDELAYTIMEOUT_R {
FRAMEDELAYTIMEOUT_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 2 - Field level is too high at max load resistance"]
#[inline(always)]
pub fn nfcfieldtoostrong(&self) -> NFCFIELDTOOSTRONG_R {
NFCFIELDTOOSTRONG_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Field level is too low at min load resistance"]
#[inline(always)]
pub fn nfcfieldtooweak(&self) -> NFCFIELDTOOWEAK_R {
NFCFIELDTOOWEAK_R::new(((self.bits >> 3) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"]
#[inline(always)]
pub fn framedelaytimeout(&mut self) -> FRAMEDELAYTIMEOUT_W {
FRAMEDELAYTIMEOUT_W { w: self }
}
#[doc = "Bit 2 - Field level is too high at max load resistance"]
#[inline(always)]
pub fn nfcfieldtoostrong(&mut self) -> NFCFIELDTOOSTRONG_W {
NFCFIELDTOOSTRONG_W { w: self }
}
#[doc = "Bit 3 - Field level is too low at min load resistance"]
#[inline(always)]
pub fn nfcfieldtooweak(&mut self) -> NFCFIELDTOOWEAK_W {
NFCFIELDTOOWEAK_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "NFC Error Status register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [errorstatus](index.html) module"]
pub struct ERRORSTATUS_SPEC;
impl crate::RegisterSpec for ERRORSTATUS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [errorstatus::R](R) reader structure"]
impl crate::Readable for ERRORSTATUS_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [errorstatus::W](W) writer structure"]
impl crate::Writable for ERRORSTATUS_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets ERRORSTATUS to value 0"]
impl crate::Resettable for ERRORSTATUS_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_AUTOCOLRESSTARTED` reader"]
pub struct R(crate::R<EVENTS_AUTOCOLRESSTARTED_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_AUTOCOLRESSTARTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_AUTOCOLRESSTARTED_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_AUTOCOLRESSTARTED_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_AUTOCOLRESSTARTED` writer"]
pub struct W(crate::W<EVENTS_AUTOCOLRESSTARTED_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_AUTOCOLRESSTARTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_AUTOCOLRESSTARTED_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_AUTOCOLRESSTARTED_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Auto collision resolution process has started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_autocolresstarted](index.html) module"]
pub struct EVENTS_AUTOCOLRESSTARTED_SPEC;
impl crate::RegisterSpec for EVENTS_AUTOCOLRESSTARTED_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_autocolresstarted::R](R) reader structure"]
impl crate::Readable for EVENTS_AUTOCOLRESSTARTED_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_autocolresstarted::W](W) writer structure"]
impl crate::Writable for EVENTS_AUTOCOLRESSTARTED_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_AUTOCOLRESSTARTED to value 0"]
impl crate::Resettable for EVENTS_AUTOCOLRESSTARTED_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_COLLISION` reader"]
pub struct R(crate::R<EVENTS_COLLISION_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_COLLISION_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_COLLISION_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_COLLISION_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_COLLISION` writer"]
pub struct W(crate::W<EVENTS_COLLISION_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_COLLISION_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_COLLISION_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_COLLISION_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "NFC Auto collision resolution error reported.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_collision](index.html) module"]
pub struct EVENTS_COLLISION_SPEC;
impl crate::RegisterSpec for EVENTS_COLLISION_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_collision::R](R) reader structure"]
impl crate::Readable for EVENTS_COLLISION_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_collision::W](W) writer structure"]
impl crate::Writable for EVENTS_COLLISION_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_COLLISION to value 0"]
impl crate::Resettable for EVENTS_COLLISION_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

64
src/nfct/events_endrx.rs Normal file
View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_ENDRX` reader"]
pub struct R(crate::R<EVENTS_ENDRX_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_ENDRX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_ENDRX_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_ENDRX_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_ENDRX` writer"]
pub struct W(crate::W<EVENTS_ENDRX_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_ENDRX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_ENDRX_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_ENDRX_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "RX buffer (as defined by PACKETPTR and MAXLEN) in Data RAM full.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endrx](index.html) module"]
pub struct EVENTS_ENDRX_SPEC;
impl crate::RegisterSpec for EVENTS_ENDRX_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_endrx::R](R) reader structure"]
impl crate::Readable for EVENTS_ENDRX_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_endrx::W](W) writer structure"]
impl crate::Writable for EVENTS_ENDRX_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_ENDRX to value 0"]
impl crate::Resettable for EVENTS_ENDRX_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

64
src/nfct/events_endtx.rs Normal file
View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_ENDTX` reader"]
pub struct R(crate::R<EVENTS_ENDTX_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_ENDTX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_ENDTX_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_ENDTX_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_ENDTX` writer"]
pub struct W(crate::W<EVENTS_ENDTX_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_ENDTX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_ENDTX_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_ENDTX_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Transmission of data in RAM has ended, and EasyDMA has ended accessing the TX buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endtx](index.html) module"]
pub struct EVENTS_ENDTX_SPEC;
impl crate::RegisterSpec for EVENTS_ENDTX_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_endtx::R](R) reader structure"]
impl crate::Readable for EVENTS_ENDTX_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_endtx::W](W) writer structure"]
impl crate::Writable for EVENTS_ENDTX_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_ENDTX to value 0"]
impl crate::Resettable for EVENTS_ENDTX_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

64
src/nfct/events_error.rs Normal file
View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_ERROR` reader"]
pub struct R(crate::R<EVENTS_ERROR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_ERROR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_ERROR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_ERROR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_ERROR` writer"]
pub struct W(crate::W<EVENTS_ERROR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_ERROR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_ERROR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_ERROR_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "NFC error reported. The ERRORSTATUS register contains details on the source of the error.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"]
pub struct EVENTS_ERROR_SPEC;
impl crate::RegisterSpec for EVENTS_ERROR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_error::R](R) reader structure"]
impl crate::Readable for EVENTS_ERROR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"]
impl crate::Writable for EVENTS_ERROR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_ERROR to value 0"]
impl crate::Resettable for EVENTS_ERROR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_FIELDDETECTED` reader"]
pub struct R(crate::R<EVENTS_FIELDDETECTED_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_FIELDDETECTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_FIELDDETECTED_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_FIELDDETECTED_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_FIELDDETECTED` writer"]
pub struct W(crate::W<EVENTS_FIELDDETECTED_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_FIELDDETECTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_FIELDDETECTED_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_FIELDDETECTED_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Remote NFC field detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_fielddetected](index.html) module"]
pub struct EVENTS_FIELDDETECTED_SPEC;
impl crate::RegisterSpec for EVENTS_FIELDDETECTED_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_fielddetected::R](R) reader structure"]
impl crate::Readable for EVENTS_FIELDDETECTED_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_fielddetected::W](W) writer structure"]
impl crate::Writable for EVENTS_FIELDDETECTED_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_FIELDDETECTED to value 0"]
impl crate::Resettable for EVENTS_FIELDDETECTED_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_FIELDLOST` reader"]
pub struct R(crate::R<EVENTS_FIELDLOST_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_FIELDLOST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_FIELDLOST_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_FIELDLOST_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_FIELDLOST` writer"]
pub struct W(crate::W<EVENTS_FIELDLOST_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_FIELDLOST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_FIELDLOST_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_FIELDLOST_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Remote NFC field lost\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_fieldlost](index.html) module"]
pub struct EVENTS_FIELDLOST_SPEC;
impl crate::RegisterSpec for EVENTS_FIELDLOST_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_fieldlost::R](R) reader structure"]
impl crate::Readable for EVENTS_FIELDLOST_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_fieldlost::W](W) writer structure"]
impl crate::Writable for EVENTS_FIELDLOST_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_FIELDLOST to value 0"]
impl crate::Resettable for EVENTS_FIELDLOST_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

64
src/nfct/events_ready.rs Normal file
View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_READY` reader"]
pub struct R(crate::R<EVENTS_READY_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_READY_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_READY_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_READY_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_READY` writer"]
pub struct W(crate::W<EVENTS_READY_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_READY_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_READY_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_READY_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "The NFC peripheral is ready to receive and send frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ready](index.html) module"]
pub struct EVENTS_READY_SPEC;
impl crate::RegisterSpec for EVENTS_READY_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_ready::R](R) reader structure"]
impl crate::Readable for EVENTS_READY_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_ready::W](W) writer structure"]
impl crate::Writable for EVENTS_READY_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_READY to value 0"]
impl crate::Resettable for EVENTS_READY_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_RXERROR` reader"]
pub struct R(crate::R<EVENTS_RXERROR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_RXERROR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_RXERROR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_RXERROR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_RXERROR` writer"]
pub struct W(crate::W<EVENTS_RXERROR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_RXERROR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_RXERROR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_RXERROR_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "NFC RX frame error reported. The FRAMESTATUS.RX register contains details on the source of the error.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxerror](index.html) module"]
pub struct EVENTS_RXERROR_SPEC;
impl crate::RegisterSpec for EVENTS_RXERROR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_rxerror::R](R) reader structure"]
impl crate::Readable for EVENTS_RXERROR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_rxerror::W](W) writer structure"]
impl crate::Writable for EVENTS_RXERROR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_RXERROR to value 0"]
impl crate::Resettable for EVENTS_RXERROR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_RXFRAMEEND` reader"]
pub struct R(crate::R<EVENTS_RXFRAMEEND_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_RXFRAMEEND_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_RXFRAMEEND_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_RXFRAMEEND_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_RXFRAMEEND` writer"]
pub struct W(crate::W<EVENTS_RXFRAMEEND_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_RXFRAMEEND_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_RXFRAMEEND_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_RXFRAMEEND_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Received data have been checked (CRC, parity) and transferred to RAM, and EasyDMA has ended accessing the RX buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxframeend](index.html) module"]
pub struct EVENTS_RXFRAMEEND_SPEC;
impl crate::RegisterSpec for EVENTS_RXFRAMEEND_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_rxframeend::R](R) reader structure"]
impl crate::Readable for EVENTS_RXFRAMEEND_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_rxframeend::W](W) writer structure"]
impl crate::Writable for EVENTS_RXFRAMEEND_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_RXFRAMEEND to value 0"]
impl crate::Resettable for EVENTS_RXFRAMEEND_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_RXFRAMESTART` reader"]
pub struct R(crate::R<EVENTS_RXFRAMESTART_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_RXFRAMESTART_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_RXFRAMESTART_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_RXFRAMESTART_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_RXFRAMESTART` writer"]
pub struct W(crate::W<EVENTS_RXFRAMESTART_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_RXFRAMESTART_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_RXFRAMESTART_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_RXFRAMESTART_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Marks the end of the first symbol of a received frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxframestart](index.html) module"]
pub struct EVENTS_RXFRAMESTART_SPEC;
impl crate::RegisterSpec for EVENTS_RXFRAMESTART_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_rxframestart::R](R) reader structure"]
impl crate::Readable for EVENTS_RXFRAMESTART_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_rxframestart::W](W) writer structure"]
impl crate::Writable for EVENTS_RXFRAMESTART_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_RXFRAMESTART to value 0"]
impl crate::Resettable for EVENTS_RXFRAMESTART_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_SELECTED` reader"]
pub struct R(crate::R<EVENTS_SELECTED_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_SELECTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_SELECTED_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_SELECTED_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_SELECTED` writer"]
pub struct W(crate::W<EVENTS_SELECTED_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_SELECTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_SELECTED_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_SELECTED_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "NFC Auto collision resolution successfully completed\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_selected](index.html) module"]
pub struct EVENTS_SELECTED_SPEC;
impl crate::RegisterSpec for EVENTS_SELECTED_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_selected::R](R) reader structure"]
impl crate::Readable for EVENTS_SELECTED_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_selected::W](W) writer structure"]
impl crate::Writable for EVENTS_SELECTED_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_SELECTED to value 0"]
impl crate::Resettable for EVENTS_SELECTED_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_STARTED` reader"]
pub struct R(crate::R<EVENTS_STARTED_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_STARTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_STARTED_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_STARTED_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_STARTED` writer"]
pub struct W(crate::W<EVENTS_STARTED_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_STARTED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_STARTED_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_STARTED_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "EasyDMA is ready to receive or send frames.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_started](index.html) module"]
pub struct EVENTS_STARTED_SPEC;
impl crate::RegisterSpec for EVENTS_STARTED_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_started::R](R) reader structure"]
impl crate::Readable for EVENTS_STARTED_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_started::W](W) writer structure"]
impl crate::Writable for EVENTS_STARTED_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_STARTED to value 0"]
impl crate::Resettable for EVENTS_STARTED_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_TXFRAMEEND` reader"]
pub struct R(crate::R<EVENTS_TXFRAMEEND_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_TXFRAMEEND_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_TXFRAMEEND_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_TXFRAMEEND_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_TXFRAMEEND` writer"]
pub struct W(crate::W<EVENTS_TXFRAMEEND_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_TXFRAMEEND_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_TXFRAMEEND_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_TXFRAMEEND_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Marks the end of the last transmitted on-air symbol of a frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txframeend](index.html) module"]
pub struct EVENTS_TXFRAMEEND_SPEC;
impl crate::RegisterSpec for EVENTS_TXFRAMEEND_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_txframeend::R](R) reader structure"]
impl crate::Readable for EVENTS_TXFRAMEEND_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_txframeend::W](W) writer structure"]
impl crate::Writable for EVENTS_TXFRAMEEND_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_TXFRAMEEND to value 0"]
impl crate::Resettable for EVENTS_TXFRAMEEND_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_TXFRAMESTART` reader"]
pub struct R(crate::R<EVENTS_TXFRAMESTART_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_TXFRAMESTART_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_TXFRAMESTART_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_TXFRAMESTART_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_TXFRAMESTART` writer"]
pub struct W(crate::W<EVENTS_TXFRAMESTART_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_TXFRAMESTART_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_TXFRAMESTART_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_TXFRAMESTART_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Marks the start of the first symbol of a transmitted frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txframestart](index.html) module"]
pub struct EVENTS_TXFRAMESTART_SPEC;
impl crate::RegisterSpec for EVENTS_TXFRAMESTART_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_txframestart::R](R) reader structure"]
impl crate::Readable for EVENTS_TXFRAMESTART_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_txframestart::W](W) writer structure"]
impl crate::Writable for EVENTS_TXFRAMESTART_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_TXFRAMESTART to value 0"]
impl crate::Resettable for EVENTS_TXFRAMESTART_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

135
src/nfct/fieldpresent.rs Normal file
View File

@@ -0,0 +1,135 @@
#[doc = "Register `FIELDPRESENT` reader"]
pub struct R(crate::R<FIELDPRESENT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FIELDPRESENT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FIELDPRESENT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<FIELDPRESENT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Indicates the presence or not of a valid field. Available only in the activated state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIELDPRESENT_A {
#[doc = "0: No valid field detected"]
NOFIELD = 0,
#[doc = "1: Valid field detected"]
FIELDPRESENT = 1,
}
impl From<FIELDPRESENT_A> for bool {
#[inline(always)]
fn from(variant: FIELDPRESENT_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `FIELDPRESENT` reader - Indicates the presence or not of a valid field. Available only in the activated state."]
pub struct FIELDPRESENT_R(crate::FieldReader<bool, FIELDPRESENT_A>);
impl FIELDPRESENT_R {
pub(crate) fn new(bits: bool) -> Self {
FIELDPRESENT_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FIELDPRESENT_A {
match self.bits {
false => FIELDPRESENT_A::NOFIELD,
true => FIELDPRESENT_A::FIELDPRESENT,
}
}
#[doc = "Checks if the value of the field is `NOFIELD`"]
#[inline(always)]
pub fn is_no_field(&self) -> bool {
**self == FIELDPRESENT_A::NOFIELD
}
#[doc = "Checks if the value of the field is `FIELDPRESENT`"]
#[inline(always)]
pub fn is_field_present(&self) -> bool {
**self == FIELDPRESENT_A::FIELDPRESENT
}
}
impl core::ops::Deref for FIELDPRESENT_R {
type Target = crate::FieldReader<bool, FIELDPRESENT_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Indicates if the low level has locked to the field\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LOCKDETECT_A {
#[doc = "0: Not locked to field"]
NOTLOCKED = 0,
#[doc = "1: Locked to field"]
LOCKED = 1,
}
impl From<LOCKDETECT_A> for bool {
#[inline(always)]
fn from(variant: LOCKDETECT_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `LOCKDETECT` reader - Indicates if the low level has locked to the field"]
pub struct LOCKDETECT_R(crate::FieldReader<bool, LOCKDETECT_A>);
impl LOCKDETECT_R {
pub(crate) fn new(bits: bool) -> Self {
LOCKDETECT_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> LOCKDETECT_A {
match self.bits {
false => LOCKDETECT_A::NOTLOCKED,
true => LOCKDETECT_A::LOCKED,
}
}
#[doc = "Checks if the value of the field is `NOTLOCKED`"]
#[inline(always)]
pub fn is_not_locked(&self) -> bool {
**self == LOCKDETECT_A::NOTLOCKED
}
#[doc = "Checks if the value of the field is `LOCKED`"]
#[inline(always)]
pub fn is_locked(&self) -> bool {
**self == LOCKDETECT_A::LOCKED
}
}
impl core::ops::Deref for LOCKDETECT_R {
type Target = crate::FieldReader<bool, LOCKDETECT_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl R {
#[doc = "Bit 0 - Indicates the presence or not of a valid field. Available only in the activated state."]
#[inline(always)]
pub fn fieldpresent(&self) -> FIELDPRESENT_R {
FIELDPRESENT_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Indicates if the low level has locked to the field"]
#[inline(always)]
pub fn lockdetect(&self) -> LOCKDETECT_R {
LOCKDETECT_R::new(((self.bits >> 1) & 0x01) != 0)
}
}
#[doc = "Indicates the presence or not of a valid field\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fieldpresent](index.html) module"]
pub struct FIELDPRESENT_SPEC;
impl crate::RegisterSpec for FIELDPRESENT_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [fieldpresent::R](R) reader structure"]
impl crate::Readable for FIELDPRESENT_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets FIELDPRESENT to value 0"]
impl crate::Resettable for FIELDPRESENT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

102
src/nfct/framedelaymax.rs Normal file
View File

@@ -0,0 +1,102 @@
#[doc = "Register `FRAMEDELAYMAX` reader"]
pub struct R(crate::R<FRAMEDELAYMAX_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FRAMEDELAYMAX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FRAMEDELAYMAX_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<FRAMEDELAYMAX_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `FRAMEDELAYMAX` writer"]
pub struct W(crate::W<FRAMEDELAYMAX_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<FRAMEDELAYMAX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<FRAMEDELAYMAX_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<FRAMEDELAYMAX_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `FRAMEDELAYMAX` reader - Maximum frame delay in number of 13.56 MHz clocks"]
pub struct FRAMEDELAYMAX_R(crate::FieldReader<u16, u16>);
impl FRAMEDELAYMAX_R {
pub(crate) fn new(bits: u16) -> Self {
FRAMEDELAYMAX_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FRAMEDELAYMAX_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FRAMEDELAYMAX` writer - Maximum frame delay in number of 13.56 MHz clocks"]
pub struct FRAMEDELAYMAX_W<'a> {
w: &'a mut W,
}
impl<'a> FRAMEDELAYMAX_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff);
self.w
}
}
impl R {
#[doc = "Bits 0:15 - Maximum frame delay in number of 13.56 MHz clocks"]
#[inline(always)]
pub fn framedelaymax(&self) -> FRAMEDELAYMAX_R {
FRAMEDELAYMAX_R::new((self.bits & 0xffff) as u16)
}
}
impl W {
#[doc = "Bits 0:15 - Maximum frame delay in number of 13.56 MHz clocks"]
#[inline(always)]
pub fn framedelaymax(&mut self) -> FRAMEDELAYMAX_W {
FRAMEDELAYMAX_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Maximum frame delay\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [framedelaymax](index.html) module"]
pub struct FRAMEDELAYMAX_SPEC;
impl crate::RegisterSpec for FRAMEDELAYMAX_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [framedelaymax::R](R) reader structure"]
impl crate::Readable for FRAMEDELAYMAX_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [framedelaymax::W](W) writer structure"]
impl crate::Writable for FRAMEDELAYMAX_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets FRAMEDELAYMAX to value 0x1000"]
impl crate::Resettable for FRAMEDELAYMAX_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x1000
}
}

102
src/nfct/framedelaymin.rs Normal file
View File

@@ -0,0 +1,102 @@
#[doc = "Register `FRAMEDELAYMIN` reader"]
pub struct R(crate::R<FRAMEDELAYMIN_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FRAMEDELAYMIN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FRAMEDELAYMIN_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<FRAMEDELAYMIN_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `FRAMEDELAYMIN` writer"]
pub struct W(crate::W<FRAMEDELAYMIN_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<FRAMEDELAYMIN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<FRAMEDELAYMIN_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<FRAMEDELAYMIN_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `FRAMEDELAYMIN` reader - Minimum frame delay in number of 13.56 MHz clocks"]
pub struct FRAMEDELAYMIN_R(crate::FieldReader<u16, u16>);
impl FRAMEDELAYMIN_R {
pub(crate) fn new(bits: u16) -> Self {
FRAMEDELAYMIN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FRAMEDELAYMIN_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FRAMEDELAYMIN` writer - Minimum frame delay in number of 13.56 MHz clocks"]
pub struct FRAMEDELAYMIN_W<'a> {
w: &'a mut W,
}
impl<'a> FRAMEDELAYMIN_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff);
self.w
}
}
impl R {
#[doc = "Bits 0:15 - Minimum frame delay in number of 13.56 MHz clocks"]
#[inline(always)]
pub fn framedelaymin(&self) -> FRAMEDELAYMIN_R {
FRAMEDELAYMIN_R::new((self.bits & 0xffff) as u16)
}
}
impl W {
#[doc = "Bits 0:15 - Minimum frame delay in number of 13.56 MHz clocks"]
#[inline(always)]
pub fn framedelaymin(&mut self) -> FRAMEDELAYMIN_W {
FRAMEDELAYMIN_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Minimum frame delay\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [framedelaymin](index.html) module"]
pub struct FRAMEDELAYMIN_SPEC;
impl crate::RegisterSpec for FRAMEDELAYMIN_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [framedelaymin::R](R) reader structure"]
impl crate::Readable for FRAMEDELAYMIN_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [framedelaymin::W](W) writer structure"]
impl crate::Writable for FRAMEDELAYMIN_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets FRAMEDELAYMIN to value 0x0480"]
impl crate::Resettable for FRAMEDELAYMIN_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x0480
}
}

177
src/nfct/framedelaymode.rs Normal file
View File

@@ -0,0 +1,177 @@
#[doc = "Register `FRAMEDELAYMODE` reader"]
pub struct R(crate::R<FRAMEDELAYMODE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FRAMEDELAYMODE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FRAMEDELAYMODE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<FRAMEDELAYMODE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `FRAMEDELAYMODE` writer"]
pub struct W(crate::W<FRAMEDELAYMODE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<FRAMEDELAYMODE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<FRAMEDELAYMODE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<FRAMEDELAYMODE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Configuration register for the Frame Delay Timer\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum FRAMEDELAYMODE_A {
#[doc = "0: Transmission is independent of frame timer and will start when the STARTTX task is triggered. No timeout."]
FREERUN = 0,
#[doc = "1: Frame is transmitted between FRAMEDELAYMIN and FRAMEDELAYMAX"]
WINDOW = 1,
#[doc = "2: Frame is transmitted exactly at FRAMEDELAYMAX"]
EXACTVAL = 2,
#[doc = "3: Frame is transmitted on a bit grid between FRAMEDELAYMIN and FRAMEDELAYMAX"]
WINDOWGRID = 3,
}
impl From<FRAMEDELAYMODE_A> for u8 {
#[inline(always)]
fn from(variant: FRAMEDELAYMODE_A) -> Self {
variant as _
}
}
#[doc = "Field `FRAMEDELAYMODE` reader - Configuration register for the Frame Delay Timer"]
pub struct FRAMEDELAYMODE_R(crate::FieldReader<u8, FRAMEDELAYMODE_A>);
impl FRAMEDELAYMODE_R {
pub(crate) fn new(bits: u8) -> Self {
FRAMEDELAYMODE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FRAMEDELAYMODE_A {
match self.bits {
0 => FRAMEDELAYMODE_A::FREERUN,
1 => FRAMEDELAYMODE_A::WINDOW,
2 => FRAMEDELAYMODE_A::EXACTVAL,
3 => FRAMEDELAYMODE_A::WINDOWGRID,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `FREERUN`"]
#[inline(always)]
pub fn is_free_run(&self) -> bool {
**self == FRAMEDELAYMODE_A::FREERUN
}
#[doc = "Checks if the value of the field is `WINDOW`"]
#[inline(always)]
pub fn is_window(&self) -> bool {
**self == FRAMEDELAYMODE_A::WINDOW
}
#[doc = "Checks if the value of the field is `EXACTVAL`"]
#[inline(always)]
pub fn is_exact_val(&self) -> bool {
**self == FRAMEDELAYMODE_A::EXACTVAL
}
#[doc = "Checks if the value of the field is `WINDOWGRID`"]
#[inline(always)]
pub fn is_window_grid(&self) -> bool {
**self == FRAMEDELAYMODE_A::WINDOWGRID
}
}
impl core::ops::Deref for FRAMEDELAYMODE_R {
type Target = crate::FieldReader<u8, FRAMEDELAYMODE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FRAMEDELAYMODE` writer - Configuration register for the Frame Delay Timer"]
pub struct FRAMEDELAYMODE_W<'a> {
w: &'a mut W,
}
impl<'a> FRAMEDELAYMODE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FRAMEDELAYMODE_A) -> &'a mut W {
self.bits(variant.into())
}
#[doc = "Transmission is independent of frame timer and will start when the STARTTX task is triggered. No timeout."]
#[inline(always)]
pub fn free_run(self) -> &'a mut W {
self.variant(FRAMEDELAYMODE_A::FREERUN)
}
#[doc = "Frame is transmitted between FRAMEDELAYMIN and FRAMEDELAYMAX"]
#[inline(always)]
pub fn window(self) -> &'a mut W {
self.variant(FRAMEDELAYMODE_A::WINDOW)
}
#[doc = "Frame is transmitted exactly at FRAMEDELAYMAX"]
#[inline(always)]
pub fn exact_val(self) -> &'a mut W {
self.variant(FRAMEDELAYMODE_A::EXACTVAL)
}
#[doc = "Frame is transmitted on a bit grid between FRAMEDELAYMIN and FRAMEDELAYMAX"]
#[inline(always)]
pub fn window_grid(self) -> &'a mut W {
self.variant(FRAMEDELAYMODE_A::WINDOWGRID)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03);
self.w
}
}
impl R {
#[doc = "Bits 0:1 - Configuration register for the Frame Delay Timer"]
#[inline(always)]
pub fn framedelaymode(&self) -> FRAMEDELAYMODE_R {
FRAMEDELAYMODE_R::new((self.bits & 0x03) as u8)
}
}
impl W {
#[doc = "Bits 0:1 - Configuration register for the Frame Delay Timer"]
#[inline(always)]
pub fn framedelaymode(&mut self) -> FRAMEDELAYMODE_W {
FRAMEDELAYMODE_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Configuration register for the Frame Delay Timer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [framedelaymode](index.html) module"]
pub struct FRAMEDELAYMODE_SPEC;
impl crate::RegisterSpec for FRAMEDELAYMODE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [framedelaymode::R](R) reader structure"]
impl crate::Readable for FRAMEDELAYMODE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [framedelaymode::W](W) writer structure"]
impl crate::Writable for FRAMEDELAYMODE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets FRAMEDELAYMODE to value 0x01"]
impl crate::Resettable for FRAMEDELAYMODE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x01
}
}

4
src/nfct/framestatus.rs Normal file
View File

@@ -0,0 +1,4 @@
#[doc = "RX register accessor: an alias for `Reg<RX_SPEC>`"]
pub type RX = crate::Reg<rx::RX_SPEC>;
#[doc = "Result of last incoming frames"]
pub mod rx;

345
src/nfct/framestatus/rx.rs Normal file
View File

@@ -0,0 +1,345 @@
#[doc = "Register `RX` reader"]
pub struct R(crate::R<RX_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<RX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<RX_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<RX_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `RX` writer"]
pub struct W(crate::W<RX_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<RX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<RX_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<RX_SPEC>) -> Self {
W(writer)
}
}
#[doc = "No valid End of Frame detected\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CRCERROR_A {
#[doc = "0: Valid CRC detected"]
CRCCORRECT = 0,
#[doc = "1: CRC received does not match local check"]
CRCERROR = 1,
}
impl From<CRCERROR_A> for bool {
#[inline(always)]
fn from(variant: CRCERROR_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CRCERROR` reader - No valid End of Frame detected"]
pub struct CRCERROR_R(crate::FieldReader<bool, CRCERROR_A>);
impl CRCERROR_R {
pub(crate) fn new(bits: bool) -> Self {
CRCERROR_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> CRCERROR_A {
match self.bits {
false => CRCERROR_A::CRCCORRECT,
true => CRCERROR_A::CRCERROR,
}
}
#[doc = "Checks if the value of the field is `CRCCORRECT`"]
#[inline(always)]
pub fn is_crccorrect(&self) -> bool {
**self == CRCERROR_A::CRCCORRECT
}
#[doc = "Checks if the value of the field is `CRCERROR`"]
#[inline(always)]
pub fn is_crcerror(&self) -> bool {
**self == CRCERROR_A::CRCERROR
}
}
impl core::ops::Deref for CRCERROR_R {
type Target = crate::FieldReader<bool, CRCERROR_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CRCERROR` writer - No valid End of Frame detected"]
pub struct CRCERROR_W<'a> {
w: &'a mut W,
}
impl<'a> CRCERROR_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CRCERROR_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Valid CRC detected"]
#[inline(always)]
pub fn crccorrect(self) -> &'a mut W {
self.variant(CRCERROR_A::CRCCORRECT)
}
#[doc = "CRC received does not match local check"]
#[inline(always)]
pub fn crcerror(self) -> &'a mut W {
self.variant(CRCERROR_A::CRCERROR)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
#[doc = "Parity status of received frame\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PARITYSTATUS_A {
#[doc = "0: Frame received with parity OK"]
PARITYOK = 0,
#[doc = "1: Frame received with parity error"]
PARITYERROR = 1,
}
impl From<PARITYSTATUS_A> for bool {
#[inline(always)]
fn from(variant: PARITYSTATUS_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `PARITYSTATUS` reader - Parity status of received frame"]
pub struct PARITYSTATUS_R(crate::FieldReader<bool, PARITYSTATUS_A>);
impl PARITYSTATUS_R {
pub(crate) fn new(bits: bool) -> Self {
PARITYSTATUS_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PARITYSTATUS_A {
match self.bits {
false => PARITYSTATUS_A::PARITYOK,
true => PARITYSTATUS_A::PARITYERROR,
}
}
#[doc = "Checks if the value of the field is `PARITYOK`"]
#[inline(always)]
pub fn is_parity_ok(&self) -> bool {
**self == PARITYSTATUS_A::PARITYOK
}
#[doc = "Checks if the value of the field is `PARITYERROR`"]
#[inline(always)]
pub fn is_parity_error(&self) -> bool {
**self == PARITYSTATUS_A::PARITYERROR
}
}
impl core::ops::Deref for PARITYSTATUS_R {
type Target = crate::FieldReader<bool, PARITYSTATUS_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PARITYSTATUS` writer - Parity status of received frame"]
pub struct PARITYSTATUS_W<'a> {
w: &'a mut W,
}
impl<'a> PARITYSTATUS_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PARITYSTATUS_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Frame received with parity OK"]
#[inline(always)]
pub fn parity_ok(self) -> &'a mut W {
self.variant(PARITYSTATUS_A::PARITYOK)
}
#[doc = "Frame received with parity error"]
#[inline(always)]
pub fn parity_error(self) -> &'a mut W {
self.variant(PARITYSTATUS_A::PARITYERROR)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Overrun detected\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OVERRUN_A {
#[doc = "0: No overrun detected"]
NOOVERRUN = 0,
#[doc = "1: Overrun error"]
OVERRUN = 1,
}
impl From<OVERRUN_A> for bool {
#[inline(always)]
fn from(variant: OVERRUN_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `OVERRUN` reader - Overrun detected"]
pub struct OVERRUN_R(crate::FieldReader<bool, OVERRUN_A>);
impl OVERRUN_R {
pub(crate) fn new(bits: bool) -> Self {
OVERRUN_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> OVERRUN_A {
match self.bits {
false => OVERRUN_A::NOOVERRUN,
true => OVERRUN_A::OVERRUN,
}
}
#[doc = "Checks if the value of the field is `NOOVERRUN`"]
#[inline(always)]
pub fn is_no_overrun(&self) -> bool {
**self == OVERRUN_A::NOOVERRUN
}
#[doc = "Checks if the value of the field is `OVERRUN`"]
#[inline(always)]
pub fn is_overrun(&self) -> bool {
**self == OVERRUN_A::OVERRUN
}
}
impl core::ops::Deref for OVERRUN_R {
type Target = crate::FieldReader<bool, OVERRUN_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `OVERRUN` writer - Overrun detected"]
pub struct OVERRUN_W<'a> {
w: &'a mut W,
}
impl<'a> OVERRUN_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: OVERRUN_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "No overrun detected"]
#[inline(always)]
pub fn no_overrun(self) -> &'a mut W {
self.variant(OVERRUN_A::NOOVERRUN)
}
#[doc = "Overrun error"]
#[inline(always)]
pub fn overrun(self) -> &'a mut W {
self.variant(OVERRUN_A::OVERRUN)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
self.w
}
}
impl R {
#[doc = "Bit 0 - No valid End of Frame detected"]
#[inline(always)]
pub fn crcerror(&self) -> CRCERROR_R {
CRCERROR_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 2 - Parity status of received frame"]
#[inline(always)]
pub fn paritystatus(&self) -> PARITYSTATUS_R {
PARITYSTATUS_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Overrun detected"]
#[inline(always)]
pub fn overrun(&self) -> OVERRUN_R {
OVERRUN_R::new(((self.bits >> 3) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - No valid End of Frame detected"]
#[inline(always)]
pub fn crcerror(&mut self) -> CRCERROR_W {
CRCERROR_W { w: self }
}
#[doc = "Bit 2 - Parity status of received frame"]
#[inline(always)]
pub fn paritystatus(&mut self) -> PARITYSTATUS_W {
PARITYSTATUS_W { w: self }
}
#[doc = "Bit 3 - Overrun detected"]
#[inline(always)]
pub fn overrun(&mut self) -> OVERRUN_W {
OVERRUN_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Result of last incoming frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx](index.html) module"]
pub struct RX_SPEC;
impl crate::RegisterSpec for RX_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [rx::R](R) reader structure"]
impl crate::Readable for RX_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [rx::W](W) writer structure"]
impl crate::Writable for RX_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets RX to value 0"]
impl crate::Resettable for RX_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

1461
src/nfct/inten.rs Normal file

File diff suppressed because it is too large Load Diff

1566
src/nfct/intenclr.rs Normal file

File diff suppressed because it is too large Load Diff

1566
src/nfct/intenset.rs Normal file

File diff suppressed because it is too large Load Diff

102
src/nfct/maxlen.rs Normal file
View File

@@ -0,0 +1,102 @@
#[doc = "Register `MAXLEN` reader"]
pub struct R(crate::R<MAXLEN_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<MAXLEN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<MAXLEN_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<MAXLEN_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `MAXLEN` writer"]
pub struct W(crate::W<MAXLEN_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<MAXLEN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<MAXLEN_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<MAXLEN_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `MAXLEN` reader - Size of allocated for TXD and RXD data storage buffer in Data RAM"]
pub struct MAXLEN_R(crate::FieldReader<u16, u16>);
impl MAXLEN_R {
pub(crate) fn new(bits: u16) -> Self {
MAXLEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MAXLEN_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MAXLEN` writer - Size of allocated for TXD and RXD data storage buffer in Data RAM"]
pub struct MAXLEN_W<'a> {
w: &'a mut W,
}
impl<'a> MAXLEN_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01ff) | (value as u32 & 0x01ff);
self.w
}
}
impl R {
#[doc = "Bits 0:8 - Size of allocated for TXD and RXD data storage buffer in Data RAM"]
#[inline(always)]
pub fn maxlen(&self) -> MAXLEN_R {
MAXLEN_R::new((self.bits & 0x01ff) as u16)
}
}
impl W {
#[doc = "Bits 0:8 - Size of allocated for TXD and RXD data storage buffer in Data RAM"]
#[inline(always)]
pub fn maxlen(&mut self) -> MAXLEN_W {
MAXLEN_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Size of allocated for TXD and RXD data storage buffer in Data RAM\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxlen](index.html) module"]
pub struct MAXLEN_SPEC;
impl crate::RegisterSpec for MAXLEN_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [maxlen::R](R) reader structure"]
impl crate::Readable for MAXLEN_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [maxlen::W](W) writer structure"]
impl crate::Writable for MAXLEN_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets MAXLEN to value 0"]
impl crate::Resettable for MAXLEN_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

174
src/nfct/nfcid1_2nd_last.rs Normal file
View File

@@ -0,0 +1,174 @@
#[doc = "Register `NFCID1_2ND_LAST` reader"]
pub struct R(crate::R<NFCID1_2ND_LAST_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<NFCID1_2ND_LAST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<NFCID1_2ND_LAST_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<NFCID1_2ND_LAST_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `NFCID1_2ND_LAST` writer"]
pub struct W(crate::W<NFCID1_2ND_LAST_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<NFCID1_2ND_LAST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<NFCID1_2ND_LAST_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<NFCID1_2ND_LAST_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `NFCID1_V` reader - NFCID1 byte V"]
pub struct NFCID1_V_R(crate::FieldReader<u8, u8>);
impl NFCID1_V_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_V_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_V_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_V` writer - NFCID1 byte V"]
pub struct NFCID1_V_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_V_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
self.w
}
}
#[doc = "Field `NFCID1_U` reader - NFCID1 byte U"]
pub struct NFCID1_U_R(crate::FieldReader<u8, u8>);
impl NFCID1_U_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_U_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_U_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_U` writer - NFCID1 byte U"]
pub struct NFCID1_U_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_U_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8);
self.w
}
}
#[doc = "Field `NFCID1_T` reader - NFCID1 byte T"]
pub struct NFCID1_T_R(crate::FieldReader<u8, u8>);
impl NFCID1_T_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_T_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_T_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_T` writer - NFCID1 byte T"]
pub struct NFCID1_T_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_T_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16);
self.w
}
}
impl R {
#[doc = "Bits 0:7 - NFCID1 byte V"]
#[inline(always)]
pub fn nfcid1_v(&self) -> NFCID1_V_R {
NFCID1_V_R::new((self.bits & 0xff) as u8)
}
#[doc = "Bits 8:15 - NFCID1 byte U"]
#[inline(always)]
pub fn nfcid1_u(&self) -> NFCID1_U_R {
NFCID1_U_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[doc = "Bits 16:23 - NFCID1 byte T"]
#[inline(always)]
pub fn nfcid1_t(&self) -> NFCID1_T_R {
NFCID1_T_R::new(((self.bits >> 16) & 0xff) as u8)
}
}
impl W {
#[doc = "Bits 0:7 - NFCID1 byte V"]
#[inline(always)]
pub fn nfcid1_v(&mut self) -> NFCID1_V_W {
NFCID1_V_W { w: self }
}
#[doc = "Bits 8:15 - NFCID1 byte U"]
#[inline(always)]
pub fn nfcid1_u(&mut self) -> NFCID1_U_W {
NFCID1_U_W { w: self }
}
#[doc = "Bits 16:23 - NFCID1 byte T"]
#[inline(always)]
pub fn nfcid1_t(&mut self) -> NFCID1_T_W {
NFCID1_T_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Second last NFCID1 part (7 or 10 bytes ID)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcid1_2nd_last](index.html) module"]
pub struct NFCID1_2ND_LAST_SPEC;
impl crate::RegisterSpec for NFCID1_2ND_LAST_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [nfcid1_2nd_last::R](R) reader structure"]
impl crate::Readable for NFCID1_2ND_LAST_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [nfcid1_2nd_last::W](W) writer structure"]
impl crate::Writable for NFCID1_2ND_LAST_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets NFCID1_2ND_LAST to value 0"]
impl crate::Resettable for NFCID1_2ND_LAST_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

174
src/nfct/nfcid1_3rd_last.rs Normal file
View File

@@ -0,0 +1,174 @@
#[doc = "Register `NFCID1_3RD_LAST` reader"]
pub struct R(crate::R<NFCID1_3RD_LAST_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<NFCID1_3RD_LAST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<NFCID1_3RD_LAST_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<NFCID1_3RD_LAST_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `NFCID1_3RD_LAST` writer"]
pub struct W(crate::W<NFCID1_3RD_LAST_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<NFCID1_3RD_LAST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<NFCID1_3RD_LAST_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<NFCID1_3RD_LAST_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `NFCID1_S` reader - NFCID1 byte S"]
pub struct NFCID1_S_R(crate::FieldReader<u8, u8>);
impl NFCID1_S_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_S_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_S_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_S` writer - NFCID1 byte S"]
pub struct NFCID1_S_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_S_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
self.w
}
}
#[doc = "Field `NFCID1_R` reader - NFCID1 byte R"]
pub struct NFCID1_R_R(crate::FieldReader<u8, u8>);
impl NFCID1_R_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_R_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_R_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_R` writer - NFCID1 byte R"]
pub struct NFCID1_R_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_R_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8);
self.w
}
}
#[doc = "Field `NFCID1_Q` reader - NFCID1 byte Q"]
pub struct NFCID1_Q_R(crate::FieldReader<u8, u8>);
impl NFCID1_Q_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_Q_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_Q_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_Q` writer - NFCID1 byte Q"]
pub struct NFCID1_Q_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_Q_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16);
self.w
}
}
impl R {
#[doc = "Bits 0:7 - NFCID1 byte S"]
#[inline(always)]
pub fn nfcid1_s(&self) -> NFCID1_S_R {
NFCID1_S_R::new((self.bits & 0xff) as u8)
}
#[doc = "Bits 8:15 - NFCID1 byte R"]
#[inline(always)]
pub fn nfcid1_r(&self) -> NFCID1_R_R {
NFCID1_R_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[doc = "Bits 16:23 - NFCID1 byte Q"]
#[inline(always)]
pub fn nfcid1_q(&self) -> NFCID1_Q_R {
NFCID1_Q_R::new(((self.bits >> 16) & 0xff) as u8)
}
}
impl W {
#[doc = "Bits 0:7 - NFCID1 byte S"]
#[inline(always)]
pub fn nfcid1_s(&mut self) -> NFCID1_S_W {
NFCID1_S_W { w: self }
}
#[doc = "Bits 8:15 - NFCID1 byte R"]
#[inline(always)]
pub fn nfcid1_r(&mut self) -> NFCID1_R_W {
NFCID1_R_W { w: self }
}
#[doc = "Bits 16:23 - NFCID1 byte Q"]
#[inline(always)]
pub fn nfcid1_q(&mut self) -> NFCID1_Q_W {
NFCID1_Q_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Third last NFCID1 part (10 bytes ID)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcid1_3rd_last](index.html) module"]
pub struct NFCID1_3RD_LAST_SPEC;
impl crate::RegisterSpec for NFCID1_3RD_LAST_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [nfcid1_3rd_last::R](R) reader structure"]
impl crate::Readable for NFCID1_3RD_LAST_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [nfcid1_3rd_last::W](W) writer structure"]
impl crate::Writable for NFCID1_3RD_LAST_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets NFCID1_3RD_LAST to value 0"]
impl crate::Resettable for NFCID1_3RD_LAST_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

210
src/nfct/nfcid1_last.rs Normal file
View File

@@ -0,0 +1,210 @@
#[doc = "Register `NFCID1_LAST` reader"]
pub struct R(crate::R<NFCID1_LAST_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<NFCID1_LAST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<NFCID1_LAST_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<NFCID1_LAST_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `NFCID1_LAST` writer"]
pub struct W(crate::W<NFCID1_LAST_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<NFCID1_LAST_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<NFCID1_LAST_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<NFCID1_LAST_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `NFCID1_Z` reader - NFCID1 byte Z (very last byte sent)"]
pub struct NFCID1_Z_R(crate::FieldReader<u8, u8>);
impl NFCID1_Z_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_Z_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_Z_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_Z` writer - NFCID1 byte Z (very last byte sent)"]
pub struct NFCID1_Z_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_Z_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
self.w
}
}
#[doc = "Field `NFCID1_Y` reader - NFCID1 byte Y"]
pub struct NFCID1_Y_R(crate::FieldReader<u8, u8>);
impl NFCID1_Y_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_Y_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_Y_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_Y` writer - NFCID1 byte Y"]
pub struct NFCID1_Y_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_Y_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8);
self.w
}
}
#[doc = "Field `NFCID1_X` reader - NFCID1 byte X"]
pub struct NFCID1_X_R(crate::FieldReader<u8, u8>);
impl NFCID1_X_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_X_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_X_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_X` writer - NFCID1 byte X"]
pub struct NFCID1_X_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_X_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16);
self.w
}
}
#[doc = "Field `NFCID1_W` reader - NFCID1 byte W"]
pub struct NFCID1_W_R(crate::FieldReader<u8, u8>);
impl NFCID1_W_R {
pub(crate) fn new(bits: u8) -> Self {
NFCID1_W_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for NFCID1_W_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCID1_W` writer - NFCID1 byte W"]
pub struct NFCID1_W_W<'a> {
w: &'a mut W,
}
impl<'a> NFCID1_W_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24);
self.w
}
}
impl R {
#[doc = "Bits 0:7 - NFCID1 byte Z (very last byte sent)"]
#[inline(always)]
pub fn nfcid1_z(&self) -> NFCID1_Z_R {
NFCID1_Z_R::new((self.bits & 0xff) as u8)
}
#[doc = "Bits 8:15 - NFCID1 byte Y"]
#[inline(always)]
pub fn nfcid1_y(&self) -> NFCID1_Y_R {
NFCID1_Y_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[doc = "Bits 16:23 - NFCID1 byte X"]
#[inline(always)]
pub fn nfcid1_x(&self) -> NFCID1_X_R {
NFCID1_X_R::new(((self.bits >> 16) & 0xff) as u8)
}
#[doc = "Bits 24:31 - NFCID1 byte W"]
#[inline(always)]
pub fn nfcid1_w(&self) -> NFCID1_W_R {
NFCID1_W_R::new(((self.bits >> 24) & 0xff) as u8)
}
}
impl W {
#[doc = "Bits 0:7 - NFCID1 byte Z (very last byte sent)"]
#[inline(always)]
pub fn nfcid1_z(&mut self) -> NFCID1_Z_W {
NFCID1_Z_W { w: self }
}
#[doc = "Bits 8:15 - NFCID1 byte Y"]
#[inline(always)]
pub fn nfcid1_y(&mut self) -> NFCID1_Y_W {
NFCID1_Y_W { w: self }
}
#[doc = "Bits 16:23 - NFCID1 byte X"]
#[inline(always)]
pub fn nfcid1_x(&mut self) -> NFCID1_X_W {
NFCID1_X_W { w: self }
}
#[doc = "Bits 24:31 - NFCID1 byte W"]
#[inline(always)]
pub fn nfcid1_w(&mut self) -> NFCID1_W_W {
NFCID1_W_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Last NFCID1 part (4, 7 or 10 bytes ID)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcid1_last](index.html) module"]
pub struct NFCID1_LAST_SPEC;
impl crate::RegisterSpec for NFCID1_LAST_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [nfcid1_last::R](R) reader structure"]
impl crate::Readable for NFCID1_LAST_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [nfcid1_last::W](W) writer structure"]
impl crate::Writable for NFCID1_LAST_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets NFCID1_LAST to value 0x6363"]
impl crate::Resettable for NFCID1_LAST_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x6363
}
}

102
src/nfct/packetptr.rs Normal file
View File

@@ -0,0 +1,102 @@
#[doc = "Register `PACKETPTR` reader"]
pub struct R(crate::R<PACKETPTR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PACKETPTR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PACKETPTR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PACKETPTR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PACKETPTR` writer"]
pub struct W(crate::W<PACKETPTR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PACKETPTR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<PACKETPTR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PACKETPTR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `PTR` reader - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."]
pub struct PTR_R(crate::FieldReader<u32, u32>);
impl PTR_R {
pub(crate) fn new(bits: u32) -> Self {
PTR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PTR_R {
type Target = crate::FieldReader<u32, u32>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PTR` writer - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."]
pub struct PTR_W<'a> {
w: &'a mut W,
}
impl<'a> PTR_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u32) -> &'a mut W {
self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff);
self.w
}
}
impl R {
#[doc = "Bits 0:31 - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."]
#[inline(always)]
pub fn ptr(&self) -> PTR_R {
PTR_R::new((self.bits & 0xffff_ffff) as u32)
}
}
impl W {
#[doc = "Bits 0:31 - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."]
#[inline(always)]
pub fn ptr(&mut self) -> PTR_W {
PTR_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Packet pointer for TXD and RXD data storage in Data RAM\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [packetptr](index.html) module"]
pub struct PACKETPTR_SPEC;
impl crate::RegisterSpec for PACKETPTR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [packetptr::R](R) reader structure"]
impl crate::Readable for PACKETPTR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [packetptr::W](W) writer structure"]
impl crate::Writable for PACKETPTR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PACKETPTR to value 0"]
impl crate::Resettable for PACKETPTR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

8
src/nfct/rxd.rs Normal file
View File

@@ -0,0 +1,8 @@
#[doc = "FRAMECONFIG register accessor: an alias for `Reg<FRAMECONFIG_SPEC>`"]
pub type FRAMECONFIG = crate::Reg<frameconfig::FRAMECONFIG_SPEC>;
#[doc = "Configuration of incoming frames"]
pub mod frameconfig;
#[doc = "AMOUNT register accessor: an alias for `Reg<AMOUNT_SPEC>`"]
pub type AMOUNT = crate::Reg<amount::AMOUNT_SPEC>;
#[doc = "Size of last incoming frame"]
pub mod amount;

71
src/nfct/rxd/amount.rs Normal file
View File

@@ -0,0 +1,71 @@
#[doc = "Register `AMOUNT` reader"]
pub struct R(crate::R<AMOUNT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<AMOUNT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<AMOUNT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<AMOUNT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `RXDATABITS` reader - Number of bits in the last byte in the frame, if less than 8 (including CRC, but excluding parity and SoF/EoF framing)."]
pub struct RXDATABITS_R(crate::FieldReader<u8, u8>);
impl RXDATABITS_R {
pub(crate) fn new(bits: u8) -> Self {
RXDATABITS_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RXDATABITS_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RXDATABYTES` reader - Number of complete bytes received in the frame (including CRC, but excluding parity and SoF/EoF framing)"]
pub struct RXDATABYTES_R(crate::FieldReader<u16, u16>);
impl RXDATABYTES_R {
pub(crate) fn new(bits: u16) -> Self {
RXDATABYTES_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RXDATABYTES_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl R {
#[doc = "Bits 0:2 - Number of bits in the last byte in the frame, if less than 8 (including CRC, but excluding parity and SoF/EoF framing)."]
#[inline(always)]
pub fn rxdatabits(&self) -> RXDATABITS_R {
RXDATABITS_R::new((self.bits & 0x07) as u8)
}
#[doc = "Bits 3:11 - Number of complete bytes received in the frame (including CRC, but excluding parity and SoF/EoF framing)"]
#[inline(always)]
pub fn rxdatabytes(&self) -> RXDATABYTES_R {
RXDATABYTES_R::new(((self.bits >> 3) & 0x01ff) as u16)
}
}
#[doc = "Size of last incoming frame\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [amount](index.html) module"]
pub struct AMOUNT_SPEC;
impl crate::RegisterSpec for AMOUNT_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [amount::R](R) reader structure"]
impl crate::Readable for AMOUNT_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets AMOUNT to value 0"]
impl crate::Resettable for AMOUNT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

345
src/nfct/rxd/frameconfig.rs Normal file
View File

@@ -0,0 +1,345 @@
#[doc = "Register `FRAMECONFIG` reader"]
pub struct R(crate::R<FRAMECONFIG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FRAMECONFIG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FRAMECONFIG_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<FRAMECONFIG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `FRAMECONFIG` writer"]
pub struct W(crate::W<FRAMECONFIG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<FRAMECONFIG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<FRAMECONFIG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<FRAMECONFIG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Parity expected or not in RX frame\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PARITY_A {
#[doc = "0: Parity is not expected in RX frames"]
NOPARITY = 0,
#[doc = "1: Parity is expected in RX frames"]
PARITY = 1,
}
impl From<PARITY_A> for bool {
#[inline(always)]
fn from(variant: PARITY_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `PARITY` reader - Parity expected or not in RX frame"]
pub struct PARITY_R(crate::FieldReader<bool, PARITY_A>);
impl PARITY_R {
pub(crate) fn new(bits: bool) -> Self {
PARITY_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PARITY_A {
match self.bits {
false => PARITY_A::NOPARITY,
true => PARITY_A::PARITY,
}
}
#[doc = "Checks if the value of the field is `NOPARITY`"]
#[inline(always)]
pub fn is_no_parity(&self) -> bool {
**self == PARITY_A::NOPARITY
}
#[doc = "Checks if the value of the field is `PARITY`"]
#[inline(always)]
pub fn is_parity(&self) -> bool {
**self == PARITY_A::PARITY
}
}
impl core::ops::Deref for PARITY_R {
type Target = crate::FieldReader<bool, PARITY_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PARITY` writer - Parity expected or not in RX frame"]
pub struct PARITY_W<'a> {
w: &'a mut W,
}
impl<'a> PARITY_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PARITY_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Parity is not expected in RX frames"]
#[inline(always)]
pub fn no_parity(self) -> &'a mut W {
self.variant(PARITY_A::NOPARITY)
}
#[doc = "Parity is expected in RX frames"]
#[inline(always)]
pub fn parity(self) -> &'a mut W {
self.variant(PARITY_A::PARITY)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
#[doc = "SoF expected or not in RX frames\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SOF_A {
#[doc = "0: Start of Frame symbol is not expected in RX frames"]
NOSOF = 0,
#[doc = "1: Start of Frame symbol is expected in RX frames"]
SOF = 1,
}
impl From<SOF_A> for bool {
#[inline(always)]
fn from(variant: SOF_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `SOF` reader - SoF expected or not in RX frames"]
pub struct SOF_R(crate::FieldReader<bool, SOF_A>);
impl SOF_R {
pub(crate) fn new(bits: bool) -> Self {
SOF_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SOF_A {
match self.bits {
false => SOF_A::NOSOF,
true => SOF_A::SOF,
}
}
#[doc = "Checks if the value of the field is `NOSOF`"]
#[inline(always)]
pub fn is_no_so_f(&self) -> bool {
**self == SOF_A::NOSOF
}
#[doc = "Checks if the value of the field is `SOF`"]
#[inline(always)]
pub fn is_so_f(&self) -> bool {
**self == SOF_A::SOF
}
}
impl core::ops::Deref for SOF_R {
type Target = crate::FieldReader<bool, SOF_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SOF` writer - SoF expected or not in RX frames"]
pub struct SOF_W<'a> {
w: &'a mut W,
}
impl<'a> SOF_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SOF_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Start of Frame symbol is not expected in RX frames"]
#[inline(always)]
pub fn no_so_f(self) -> &'a mut W {
self.variant(SOF_A::NOSOF)
}
#[doc = "Start of Frame symbol is expected in RX frames"]
#[inline(always)]
pub fn so_f(self) -> &'a mut W {
self.variant(SOF_A::SOF)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "CRC mode for incoming frames\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CRCMODERX_A {
#[doc = "0: CRC is not expected in RX frames"]
NOCRCRX = 0,
#[doc = "1: Last 16 bits in RX frame is CRC, CRC is checked and CRCSTATUS updated"]
CRC16RX = 1,
}
impl From<CRCMODERX_A> for bool {
#[inline(always)]
fn from(variant: CRCMODERX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CRCMODERX` reader - CRC mode for incoming frames"]
pub struct CRCMODERX_R(crate::FieldReader<bool, CRCMODERX_A>);
impl CRCMODERX_R {
pub(crate) fn new(bits: bool) -> Self {
CRCMODERX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> CRCMODERX_A {
match self.bits {
false => CRCMODERX_A::NOCRCRX,
true => CRCMODERX_A::CRC16RX,
}
}
#[doc = "Checks if the value of the field is `NOCRCRX`"]
#[inline(always)]
pub fn is_no_crcrx(&self) -> bool {
**self == CRCMODERX_A::NOCRCRX
}
#[doc = "Checks if the value of the field is `CRC16RX`"]
#[inline(always)]
pub fn is_crc16rx(&self) -> bool {
**self == CRCMODERX_A::CRC16RX
}
}
impl core::ops::Deref for CRCMODERX_R {
type Target = crate::FieldReader<bool, CRCMODERX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CRCMODERX` writer - CRC mode for incoming frames"]
pub struct CRCMODERX_W<'a> {
w: &'a mut W,
}
impl<'a> CRCMODERX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CRCMODERX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "CRC is not expected in RX frames"]
#[inline(always)]
pub fn no_crcrx(self) -> &'a mut W {
self.variant(CRCMODERX_A::NOCRCRX)
}
#[doc = "Last 16 bits in RX frame is CRC, CRC is checked and CRCSTATUS updated"]
#[inline(always)]
pub fn crc16rx(self) -> &'a mut W {
self.variant(CRCMODERX_A::CRC16RX)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
self.w
}
}
impl R {
#[doc = "Bit 0 - Parity expected or not in RX frame"]
#[inline(always)]
pub fn parity(&self) -> PARITY_R {
PARITY_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 2 - SoF expected or not in RX frames"]
#[inline(always)]
pub fn sof(&self) -> SOF_R {
SOF_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 4 - CRC mode for incoming frames"]
#[inline(always)]
pub fn crcmoderx(&self) -> CRCMODERX_R {
CRCMODERX_R::new(((self.bits >> 4) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Parity expected or not in RX frame"]
#[inline(always)]
pub fn parity(&mut self) -> PARITY_W {
PARITY_W { w: self }
}
#[doc = "Bit 2 - SoF expected or not in RX frames"]
#[inline(always)]
pub fn sof(&mut self) -> SOF_W {
SOF_W { w: self }
}
#[doc = "Bit 4 - CRC mode for incoming frames"]
#[inline(always)]
pub fn crcmoderx(&mut self) -> CRCMODERX_W {
CRCMODERX_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Configuration of incoming frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frameconfig](index.html) module"]
pub struct FRAMECONFIG_SPEC;
impl crate::RegisterSpec for FRAMECONFIG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [frameconfig::R](R) reader structure"]
impl crate::Readable for FRAMECONFIG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [frameconfig::W](W) writer structure"]
impl crate::Writable for FRAMECONFIG_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets FRAMECONFIG to value 0x15"]
impl crate::Resettable for FRAMECONFIG_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x15
}
}

313
src/nfct/selres.rs Normal file
View File

@@ -0,0 +1,313 @@
#[doc = "Register `SELRES` reader"]
pub struct R(crate::R<SELRES_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SELRES_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SELRES_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SELRES_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SELRES` writer"]
pub struct W(crate::W<SELRES_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SELRES_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SELRES_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SELRES_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `RFU10` reader - Reserved for future use. Shall be 0."]
pub struct RFU10_R(crate::FieldReader<u8, u8>);
impl RFU10_R {
pub(crate) fn new(bits: u8) -> Self {
RFU10_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RFU10_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RFU10` writer - Reserved for future use. Shall be 0."]
pub struct RFU10_W<'a> {
w: &'a mut W,
}
impl<'a> RFU10_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03);
self.w
}
}
#[doc = "Cascade bit (controlled by hardware, write has no effect)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CASCADE_A {
#[doc = "0: NFCID1 complete"]
COMPLETE = 0,
#[doc = "1: NFCID1 not complete"]
NOTCOMPLETE = 1,
}
impl From<CASCADE_A> for bool {
#[inline(always)]
fn from(variant: CASCADE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CASCADE` reader - Cascade bit (controlled by hardware, write has no effect)"]
pub struct CASCADE_R(crate::FieldReader<bool, CASCADE_A>);
impl CASCADE_R {
pub(crate) fn new(bits: bool) -> Self {
CASCADE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> CASCADE_A {
match self.bits {
false => CASCADE_A::COMPLETE,
true => CASCADE_A::NOTCOMPLETE,
}
}
#[doc = "Checks if the value of the field is `COMPLETE`"]
#[inline(always)]
pub fn is_complete(&self) -> bool {
**self == CASCADE_A::COMPLETE
}
#[doc = "Checks if the value of the field is `NOTCOMPLETE`"]
#[inline(always)]
pub fn is_not_complete(&self) -> bool {
**self == CASCADE_A::NOTCOMPLETE
}
}
impl core::ops::Deref for CASCADE_R {
type Target = crate::FieldReader<bool, CASCADE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CASCADE` writer - Cascade bit (controlled by hardware, write has no effect)"]
pub struct CASCADE_W<'a> {
w: &'a mut W,
}
impl<'a> CASCADE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CASCADE_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "NFCID1 complete"]
#[inline(always)]
pub fn complete(self) -> &'a mut W {
self.variant(CASCADE_A::COMPLETE)
}
#[doc = "NFCID1 not complete"]
#[inline(always)]
pub fn not_complete(self) -> &'a mut W {
self.variant(CASCADE_A::NOTCOMPLETE)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Field `RFU43` reader - Reserved for future use. Shall be 0."]
pub struct RFU43_R(crate::FieldReader<u8, u8>);
impl RFU43_R {
pub(crate) fn new(bits: u8) -> Self {
RFU43_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RFU43_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RFU43` writer - Reserved for future use. Shall be 0."]
pub struct RFU43_W<'a> {
w: &'a mut W,
}
impl<'a> RFU43_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 3)) | ((value as u32 & 0x03) << 3);
self.w
}
}
#[doc = "Field `PROTOCOL` reader - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
pub struct PROTOCOL_R(crate::FieldReader<u8, u8>);
impl PROTOCOL_R {
pub(crate) fn new(bits: u8) -> Self {
PROTOCOL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PROTOCOL_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PROTOCOL` writer - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
pub struct PROTOCOL_W<'a> {
w: &'a mut W,
}
impl<'a> PROTOCOL_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5);
self.w
}
}
#[doc = "Field `RFU7` reader - Reserved for future use. Shall be 0."]
pub struct RFU7_R(crate::FieldReader<bool, bool>);
impl RFU7_R {
pub(crate) fn new(bits: bool) -> Self {
RFU7_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RFU7_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RFU7` writer - Reserved for future use. Shall be 0."]
pub struct RFU7_W<'a> {
w: &'a mut W,
}
impl<'a> RFU7_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
self.w
}
}
impl R {
#[doc = "Bits 0:1 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu10(&self) -> RFU10_R {
RFU10_R::new((self.bits & 0x03) as u8)
}
#[doc = "Bit 2 - Cascade bit (controlled by hardware, write has no effect)"]
#[inline(always)]
pub fn cascade(&self) -> CASCADE_R {
CASCADE_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bits 3:4 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu43(&self) -> RFU43_R {
RFU43_R::new(((self.bits >> 3) & 0x03) as u8)
}
#[doc = "Bits 5:6 - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
#[inline(always)]
pub fn protocol(&self) -> PROTOCOL_R {
PROTOCOL_R::new(((self.bits >> 5) & 0x03) as u8)
}
#[doc = "Bit 7 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu7(&self) -> RFU7_R {
RFU7_R::new(((self.bits >> 7) & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 0:1 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu10(&mut self) -> RFU10_W {
RFU10_W { w: self }
}
#[doc = "Bit 2 - Cascade bit (controlled by hardware, write has no effect)"]
#[inline(always)]
pub fn cascade(&mut self) -> CASCADE_W {
CASCADE_W { w: self }
}
#[doc = "Bits 3:4 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu43(&mut self) -> RFU43_W {
RFU43_W { w: self }
}
#[doc = "Bits 5:6 - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
#[inline(always)]
pub fn protocol(&mut self) -> PROTOCOL_W {
PROTOCOL_W { w: self }
}
#[doc = "Bit 7 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu7(&mut self) -> RFU7_W {
RFU7_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "NFC-A SEL_RES auto-response settings\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [selres](index.html) module"]
pub struct SELRES_SPEC;
impl crate::RegisterSpec for SELRES_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [selres::R](R) reader structure"]
impl crate::Readable for SELRES_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [selres::W](W) writer structure"]
impl crate::Writable for SELRES_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SELRES to value 0"]
impl crate::Resettable for SELRES_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

419
src/nfct/sensres.rs Normal file
View File

@@ -0,0 +1,419 @@
#[doc = "Register `SENSRES` reader"]
pub struct R(crate::R<SENSRES_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SENSRES_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SENSRES_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SENSRES_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SENSRES` writer"]
pub struct W(crate::W<SENSRES_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SENSRES_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SENSRES_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SENSRES_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum BITFRAMESDD_A {
#[doc = "0: SDD pattern 00000"]
SDD00000 = 0,
#[doc = "1: SDD pattern 00001"]
SDD00001 = 1,
#[doc = "2: SDD pattern 00010"]
SDD00010 = 2,
#[doc = "4: SDD pattern 00100"]
SDD00100 = 4,
#[doc = "8: SDD pattern 01000"]
SDD01000 = 8,
#[doc = "16: SDD pattern 10000"]
SDD10000 = 16,
}
impl From<BITFRAMESDD_A> for u8 {
#[inline(always)]
fn from(variant: BITFRAMESDD_A) -> Self {
variant as _
}
}
#[doc = "Field `BITFRAMESDD` reader - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
pub struct BITFRAMESDD_R(crate::FieldReader<u8, BITFRAMESDD_A>);
impl BITFRAMESDD_R {
pub(crate) fn new(bits: u8) -> Self {
BITFRAMESDD_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<BITFRAMESDD_A> {
match self.bits {
0 => Some(BITFRAMESDD_A::SDD00000),
1 => Some(BITFRAMESDD_A::SDD00001),
2 => Some(BITFRAMESDD_A::SDD00010),
4 => Some(BITFRAMESDD_A::SDD00100),
8 => Some(BITFRAMESDD_A::SDD01000),
16 => Some(BITFRAMESDD_A::SDD10000),
_ => None,
}
}
#[doc = "Checks if the value of the field is `SDD00000`"]
#[inline(always)]
pub fn is_sdd00000(&self) -> bool {
**self == BITFRAMESDD_A::SDD00000
}
#[doc = "Checks if the value of the field is `SDD00001`"]
#[inline(always)]
pub fn is_sdd00001(&self) -> bool {
**self == BITFRAMESDD_A::SDD00001
}
#[doc = "Checks if the value of the field is `SDD00010`"]
#[inline(always)]
pub fn is_sdd00010(&self) -> bool {
**self == BITFRAMESDD_A::SDD00010
}
#[doc = "Checks if the value of the field is `SDD00100`"]
#[inline(always)]
pub fn is_sdd00100(&self) -> bool {
**self == BITFRAMESDD_A::SDD00100
}
#[doc = "Checks if the value of the field is `SDD01000`"]
#[inline(always)]
pub fn is_sdd01000(&self) -> bool {
**self == BITFRAMESDD_A::SDD01000
}
#[doc = "Checks if the value of the field is `SDD10000`"]
#[inline(always)]
pub fn is_sdd10000(&self) -> bool {
**self == BITFRAMESDD_A::SDD10000
}
}
impl core::ops::Deref for BITFRAMESDD_R {
type Target = crate::FieldReader<u8, BITFRAMESDD_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `BITFRAMESDD` writer - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
pub struct BITFRAMESDD_W<'a> {
w: &'a mut W,
}
impl<'a> BITFRAMESDD_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: BITFRAMESDD_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "SDD pattern 00000"]
#[inline(always)]
pub fn sdd00000(self) -> &'a mut W {
self.variant(BITFRAMESDD_A::SDD00000)
}
#[doc = "SDD pattern 00001"]
#[inline(always)]
pub fn sdd00001(self) -> &'a mut W {
self.variant(BITFRAMESDD_A::SDD00001)
}
#[doc = "SDD pattern 00010"]
#[inline(always)]
pub fn sdd00010(self) -> &'a mut W {
self.variant(BITFRAMESDD_A::SDD00010)
}
#[doc = "SDD pattern 00100"]
#[inline(always)]
pub fn sdd00100(self) -> &'a mut W {
self.variant(BITFRAMESDD_A::SDD00100)
}
#[doc = "SDD pattern 01000"]
#[inline(always)]
pub fn sdd01000(self) -> &'a mut W {
self.variant(BITFRAMESDD_A::SDD01000)
}
#[doc = "SDD pattern 10000"]
#[inline(always)]
pub fn sdd10000(self) -> &'a mut W {
self.variant(BITFRAMESDD_A::SDD10000)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f);
self.w
}
}
#[doc = "Field `RFU5` reader - Reserved for future use. Shall be 0."]
pub struct RFU5_R(crate::FieldReader<bool, bool>);
impl RFU5_R {
pub(crate) fn new(bits: bool) -> Self {
RFU5_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RFU5_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RFU5` writer - Reserved for future use. Shall be 0."]
pub struct RFU5_W<'a> {
w: &'a mut W,
}
impl<'a> RFU5_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
self.w
}
}
#[doc = "NFCID1 size. This value is used by the Auto collision resolution engine.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum NFCIDSIZE_A {
#[doc = "0: NFCID1 size: single (4 bytes)"]
NFCID1SINGLE = 0,
#[doc = "1: NFCID1 size: double (7 bytes)"]
NFCID1DOUBLE = 1,
#[doc = "2: NFCID1 size: triple (10 bytes)"]
NFCID1TRIPLE = 2,
}
impl From<NFCIDSIZE_A> for u8 {
#[inline(always)]
fn from(variant: NFCIDSIZE_A) -> Self {
variant as _
}
}
#[doc = "Field `NFCIDSIZE` reader - NFCID1 size. This value is used by the Auto collision resolution engine."]
pub struct NFCIDSIZE_R(crate::FieldReader<u8, NFCIDSIZE_A>);
impl NFCIDSIZE_R {
pub(crate) fn new(bits: u8) -> Self {
NFCIDSIZE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<NFCIDSIZE_A> {
match self.bits {
0 => Some(NFCIDSIZE_A::NFCID1SINGLE),
1 => Some(NFCIDSIZE_A::NFCID1DOUBLE),
2 => Some(NFCIDSIZE_A::NFCID1TRIPLE),
_ => None,
}
}
#[doc = "Checks if the value of the field is `NFCID1SINGLE`"]
#[inline(always)]
pub fn is_nfcid1single(&self) -> bool {
**self == NFCIDSIZE_A::NFCID1SINGLE
}
#[doc = "Checks if the value of the field is `NFCID1DOUBLE`"]
#[inline(always)]
pub fn is_nfcid1double(&self) -> bool {
**self == NFCIDSIZE_A::NFCID1DOUBLE
}
#[doc = "Checks if the value of the field is `NFCID1TRIPLE`"]
#[inline(always)]
pub fn is_nfcid1triple(&self) -> bool {
**self == NFCIDSIZE_A::NFCID1TRIPLE
}
}
impl core::ops::Deref for NFCIDSIZE_R {
type Target = crate::FieldReader<u8, NFCIDSIZE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `NFCIDSIZE` writer - NFCID1 size. This value is used by the Auto collision resolution engine."]
pub struct NFCIDSIZE_W<'a> {
w: &'a mut W,
}
impl<'a> NFCIDSIZE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: NFCIDSIZE_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "NFCID1 size: single (4 bytes)"]
#[inline(always)]
pub fn nfcid1single(self) -> &'a mut W {
self.variant(NFCIDSIZE_A::NFCID1SINGLE)
}
#[doc = "NFCID1 size: double (7 bytes)"]
#[inline(always)]
pub fn nfcid1double(self) -> &'a mut W {
self.variant(NFCIDSIZE_A::NFCID1DOUBLE)
}
#[doc = "NFCID1 size: triple (10 bytes)"]
#[inline(always)]
pub fn nfcid1triple(self) -> &'a mut W {
self.variant(NFCIDSIZE_A::NFCID1TRIPLE)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6);
self.w
}
}
#[doc = "Field `PLATFCONFIG` reader - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
pub struct PLATFCONFIG_R(crate::FieldReader<u8, u8>);
impl PLATFCONFIG_R {
pub(crate) fn new(bits: u8) -> Self {
PLATFCONFIG_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLATFCONFIG_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLATFCONFIG` writer - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
pub struct PLATFCONFIG_W<'a> {
w: &'a mut W,
}
impl<'a> PLATFCONFIG_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8);
self.w
}
}
#[doc = "Field `RFU74` reader - Reserved for future use. Shall be 0."]
pub struct RFU74_R(crate::FieldReader<u8, u8>);
impl RFU74_R {
pub(crate) fn new(bits: u8) -> Self {
RFU74_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RFU74_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RFU74` writer - Reserved for future use. Shall be 0."]
pub struct RFU74_W<'a> {
w: &'a mut W,
}
impl<'a> RFU74_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12);
self.w
}
}
impl R {
#[doc = "Bits 0:4 - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
#[inline(always)]
pub fn bitframesdd(&self) -> BITFRAMESDD_R {
BITFRAMESDD_R::new((self.bits & 0x1f) as u8)
}
#[doc = "Bit 5 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu5(&self) -> RFU5_R {
RFU5_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bits 6:7 - NFCID1 size. This value is used by the Auto collision resolution engine."]
#[inline(always)]
pub fn nfcidsize(&self) -> NFCIDSIZE_R {
NFCIDSIZE_R::new(((self.bits >> 6) & 0x03) as u8)
}
#[doc = "Bits 8:11 - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
#[inline(always)]
pub fn platfconfig(&self) -> PLATFCONFIG_R {
PLATFCONFIG_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[doc = "Bits 12:15 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu74(&self) -> RFU74_R {
RFU74_R::new(((self.bits >> 12) & 0x0f) as u8)
}
}
impl W {
#[doc = "Bits 0:4 - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
#[inline(always)]
pub fn bitframesdd(&mut self) -> BITFRAMESDD_W {
BITFRAMESDD_W { w: self }
}
#[doc = "Bit 5 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu5(&mut self) -> RFU5_W {
RFU5_W { w: self }
}
#[doc = "Bits 6:7 - NFCID1 size. This value is used by the Auto collision resolution engine."]
#[inline(always)]
pub fn nfcidsize(&mut self) -> NFCIDSIZE_W {
NFCIDSIZE_W { w: self }
}
#[doc = "Bits 8:11 - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
#[inline(always)]
pub fn platfconfig(&mut self) -> PLATFCONFIG_W {
PLATFCONFIG_W { w: self }
}
#[doc = "Bits 12:15 - Reserved for future use. Shall be 0."]
#[inline(always)]
pub fn rfu74(&mut self) -> RFU74_W {
RFU74_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "NFC-A SENS_RES auto-response settings\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sensres](index.html) module"]
pub struct SENSRES_SPEC;
impl crate::RegisterSpec for SENSRES_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [sensres::R](R) reader structure"]
impl crate::Readable for SENSRES_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [sensres::W](W) writer structure"]
impl crate::Writable for SENSRES_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SENSRES to value 0x01"]
impl crate::Resettable for SENSRES_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x01
}
}

252
src/nfct/shorts.rs Normal file
View File

@@ -0,0 +1,252 @@
#[doc = "Register `SHORTS` reader"]
pub struct R(crate::R<SHORTS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SHORTS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SHORTS_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SHORTS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SHORTS` writer"]
pub struct W(crate::W<SHORTS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SHORTS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SHORTS_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SHORTS_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Shortcut between FIELDDETECTED event and ACTIVATE task\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIELDDETECTED_ACTIVATE_A {
#[doc = "0: Disable shortcut"]
DISABLED = 0,
#[doc = "1: Enable shortcut"]
ENABLED = 1,
}
impl From<FIELDDETECTED_ACTIVATE_A> for bool {
#[inline(always)]
fn from(variant: FIELDDETECTED_ACTIVATE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `FIELDDETECTED_ACTIVATE` reader - Shortcut between FIELDDETECTED event and ACTIVATE task"]
pub struct FIELDDETECTED_ACTIVATE_R(crate::FieldReader<bool, FIELDDETECTED_ACTIVATE_A>);
impl FIELDDETECTED_ACTIVATE_R {
pub(crate) fn new(bits: bool) -> Self {
FIELDDETECTED_ACTIVATE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FIELDDETECTED_ACTIVATE_A {
match self.bits {
false => FIELDDETECTED_ACTIVATE_A::DISABLED,
true => FIELDDETECTED_ACTIVATE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == FIELDDETECTED_ACTIVATE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == FIELDDETECTED_ACTIVATE_A::ENABLED
}
}
impl core::ops::Deref for FIELDDETECTED_ACTIVATE_R {
type Target = crate::FieldReader<bool, FIELDDETECTED_ACTIVATE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FIELDDETECTED_ACTIVATE` writer - Shortcut between FIELDDETECTED event and ACTIVATE task"]
pub struct FIELDDETECTED_ACTIVATE_W<'a> {
w: &'a mut W,
}
impl<'a> FIELDDETECTED_ACTIVATE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FIELDDETECTED_ACTIVATE_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Disable shortcut"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(FIELDDETECTED_ACTIVATE_A::DISABLED)
}
#[doc = "Enable shortcut"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(FIELDDETECTED_ACTIVATE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
#[doc = "Shortcut between FIELDLOST event and SENSE task\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIELDLOST_SENSE_A {
#[doc = "0: Disable shortcut"]
DISABLED = 0,
#[doc = "1: Enable shortcut"]
ENABLED = 1,
}
impl From<FIELDLOST_SENSE_A> for bool {
#[inline(always)]
fn from(variant: FIELDLOST_SENSE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `FIELDLOST_SENSE` reader - Shortcut between FIELDLOST event and SENSE task"]
pub struct FIELDLOST_SENSE_R(crate::FieldReader<bool, FIELDLOST_SENSE_A>);
impl FIELDLOST_SENSE_R {
pub(crate) fn new(bits: bool) -> Self {
FIELDLOST_SENSE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FIELDLOST_SENSE_A {
match self.bits {
false => FIELDLOST_SENSE_A::DISABLED,
true => FIELDLOST_SENSE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
**self == FIELDLOST_SENSE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == FIELDLOST_SENSE_A::ENABLED
}
}
impl core::ops::Deref for FIELDLOST_SENSE_R {
type Target = crate::FieldReader<bool, FIELDLOST_SENSE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FIELDLOST_SENSE` writer - Shortcut between FIELDLOST event and SENSE task"]
pub struct FIELDLOST_SENSE_W<'a> {
w: &'a mut W,
}
impl<'a> FIELDLOST_SENSE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FIELDLOST_SENSE_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Disable shortcut"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(FIELDLOST_SENSE_A::DISABLED)
}
#[doc = "Enable shortcut"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(FIELDLOST_SENSE_A::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
impl R {
#[doc = "Bit 0 - Shortcut between FIELDDETECTED event and ACTIVATE task"]
#[inline(always)]
pub fn fielddetected_activate(&self) -> FIELDDETECTED_ACTIVATE_R {
FIELDDETECTED_ACTIVATE_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Shortcut between FIELDLOST event and SENSE task"]
#[inline(always)]
pub fn fieldlost_sense(&self) -> FIELDLOST_SENSE_R {
FIELDLOST_SENSE_R::new(((self.bits >> 1) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Shortcut between FIELDDETECTED event and ACTIVATE task"]
#[inline(always)]
pub fn fielddetected_activate(&mut self) -> FIELDDETECTED_ACTIVATE_W {
FIELDDETECTED_ACTIVATE_W { w: self }
}
#[doc = "Bit 1 - Shortcut between FIELDLOST event and SENSE task"]
#[inline(always)]
pub fn fieldlost_sense(&mut self) -> FIELDLOST_SENSE_W {
FIELDLOST_SENSE_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"]
pub struct SHORTS_SPEC;
impl crate::RegisterSpec for SHORTS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [shorts::R](R) reader structure"]
impl crate::Readable for SHORTS_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"]
impl crate::Writable for SHORTS_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SHORTS to value 0"]
impl crate::Resettable for SHORTS_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_ACTIVATE` writer"]
pub struct W(crate::W<TASKS_ACTIVATE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_ACTIVATE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_ACTIVATE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_ACTIVATE_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Activate NFC peripheral for incoming and outgoing frames, change state to activated\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_activate](index.html) module"]
pub struct TASKS_ACTIVATE_SPEC;
impl crate::RegisterSpec for TASKS_ACTIVATE_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_activate::W](W) writer structure"]
impl crate::Writable for TASKS_ACTIVATE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_ACTIVATE to value 0"]
impl crate::Resettable for TASKS_ACTIVATE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

45
src/nfct/tasks_disable.rs Normal file
View File

@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_DISABLE` writer"]
pub struct W(crate::W<TASKS_DISABLE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_DISABLE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_DISABLE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_DISABLE_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Disable NFC peripheral\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_disable](index.html) module"]
pub struct TASKS_DISABLE_SPEC;
impl crate::RegisterSpec for TASKS_DISABLE_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_disable::W](W) writer structure"]
impl crate::Writable for TASKS_DISABLE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_DISABLE to value 0"]
impl crate::Resettable for TASKS_DISABLE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

View File

@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_ENABLERXDATA` writer"]
pub struct W(crate::W<TASKS_ENABLERXDATA_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_ENABLERXDATA_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_ENABLERXDATA_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_ENABLERXDATA_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Initializes the EasyDMA for receive.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_enablerxdata](index.html) module"]
pub struct TASKS_ENABLERXDATA_SPEC;
impl crate::RegisterSpec for TASKS_ENABLERXDATA_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_enablerxdata::W](W) writer structure"]
impl crate::Writable for TASKS_ENABLERXDATA_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_ENABLERXDATA to value 0"]
impl crate::Resettable for TASKS_ENABLERXDATA_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

45
src/nfct/tasks_goidle.rs Normal file
View File

@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_GOIDLE` writer"]
pub struct W(crate::W<TASKS_GOIDLE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_GOIDLE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_GOIDLE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_GOIDLE_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Force state machine to IDLE state\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_goidle](index.html) module"]
pub struct TASKS_GOIDLE_SPEC;
impl crate::RegisterSpec for TASKS_GOIDLE_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_goidle::W](W) writer structure"]
impl crate::Writable for TASKS_GOIDLE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_GOIDLE to value 0"]
impl crate::Resettable for TASKS_GOIDLE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

45
src/nfct/tasks_gosleep.rs Normal file
View File

@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_GOSLEEP` writer"]
pub struct W(crate::W<TASKS_GOSLEEP_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_GOSLEEP_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_GOSLEEP_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_GOSLEEP_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Force state machine to SLEEP_A state\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_gosleep](index.html) module"]
pub struct TASKS_GOSLEEP_SPEC;
impl crate::RegisterSpec for TASKS_GOSLEEP_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_gosleep::W](W) writer structure"]
impl crate::Writable for TASKS_GOSLEEP_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_GOSLEEP to value 0"]
impl crate::Resettable for TASKS_GOSLEEP_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

45
src/nfct/tasks_sense.rs Normal file
View File

@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_SENSE` writer"]
pub struct W(crate::W<TASKS_SENSE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_SENSE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_SENSE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_SENSE_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Enable NFC sense field mode, change state to sense mode\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_sense](index.html) module"]
pub struct TASKS_SENSE_SPEC;
impl crate::RegisterSpec for TASKS_SENSE_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_sense::W](W) writer structure"]
impl crate::Writable for TASKS_SENSE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_SENSE to value 0"]
impl crate::Resettable for TASKS_SENSE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

45
src/nfct/tasks_starttx.rs Normal file
View File

@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_STARTTX` writer"]
pub struct W(crate::W<TASKS_STARTTX_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_STARTTX_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_STARTTX_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_STARTTX_SPEC>) -> Self {
W(writer)
}
}
impl W {
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Start transmission of a outgoing frame, change state to transmit\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_starttx](index.html) module"]
pub struct TASKS_STARTTX_SPEC;
impl crate::RegisterSpec for TASKS_STARTTX_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_starttx::W](W) writer structure"]
impl crate::Writable for TASKS_STARTTX_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_STARTTX to value 0"]
impl crate::Resettable for TASKS_STARTTX_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

8
src/nfct/txd.rs Normal file
View File

@@ -0,0 +1,8 @@
#[doc = "FRAMECONFIG register accessor: an alias for `Reg<FRAMECONFIG_SPEC>`"]
pub type FRAMECONFIG = crate::Reg<frameconfig::FRAMECONFIG_SPEC>;
#[doc = "Configuration of outgoing frames"]
pub mod frameconfig;
#[doc = "AMOUNT register accessor: an alias for `Reg<AMOUNT_SPEC>`"]
pub type AMOUNT = crate::Reg<amount::AMOUNT_SPEC>;
#[doc = "Size of outgoing frame"]
pub mod amount;

138
src/nfct/txd/amount.rs Normal file
View File

@@ -0,0 +1,138 @@
#[doc = "Register `AMOUNT` reader"]
pub struct R(crate::R<AMOUNT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<AMOUNT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<AMOUNT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<AMOUNT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `AMOUNT` writer"]
pub struct W(crate::W<AMOUNT_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<AMOUNT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<AMOUNT_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<AMOUNT_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `TXDATABITS` reader - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."]
pub struct TXDATABITS_R(crate::FieldReader<u8, u8>);
impl TXDATABITS_R {
pub(crate) fn new(bits: u8) -> Self {
TXDATABITS_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TXDATABITS_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TXDATABITS` writer - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."]
pub struct TXDATABITS_W<'a> {
w: &'a mut W,
}
impl<'a> TXDATABITS_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07);
self.w
}
}
#[doc = "Field `TXDATABYTES` reader - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"]
pub struct TXDATABYTES_R(crate::FieldReader<u16, u16>);
impl TXDATABYTES_R {
pub(crate) fn new(bits: u16) -> Self {
TXDATABYTES_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TXDATABYTES_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TXDATABYTES` writer - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"]
pub struct TXDATABYTES_W<'a> {
w: &'a mut W,
}
impl<'a> TXDATABYTES_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01ff << 3)) | ((value as u32 & 0x01ff) << 3);
self.w
}
}
impl R {
#[doc = "Bits 0:2 - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."]
#[inline(always)]
pub fn txdatabits(&self) -> TXDATABITS_R {
TXDATABITS_R::new((self.bits & 0x07) as u8)
}
#[doc = "Bits 3:11 - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"]
#[inline(always)]
pub fn txdatabytes(&self) -> TXDATABYTES_R {
TXDATABYTES_R::new(((self.bits >> 3) & 0x01ff) as u16)
}
}
impl W {
#[doc = "Bits 0:2 - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."]
#[inline(always)]
pub fn txdatabits(&mut self) -> TXDATABITS_W {
TXDATABITS_W { w: self }
}
#[doc = "Bits 3:11 - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"]
#[inline(always)]
pub fn txdatabytes(&mut self) -> TXDATABYTES_W {
TXDATABYTES_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Size of outgoing frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [amount](index.html) module"]
pub struct AMOUNT_SPEC;
impl crate::RegisterSpec for AMOUNT_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [amount::R](R) reader structure"]
impl crate::Readable for AMOUNT_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [amount::W](W) writer structure"]
impl crate::Writable for AMOUNT_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets AMOUNT to value 0"]
impl crate::Resettable for AMOUNT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}

438
src/nfct/txd/frameconfig.rs Normal file
View File

@@ -0,0 +1,438 @@
#[doc = "Register `FRAMECONFIG` reader"]
pub struct R(crate::R<FRAMECONFIG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FRAMECONFIG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FRAMECONFIG_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<FRAMECONFIG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `FRAMECONFIG` writer"]
pub struct W(crate::W<FRAMECONFIG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<FRAMECONFIG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<FRAMECONFIG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<FRAMECONFIG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Adding parity or not in the frame\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PARITY_A {
#[doc = "0: Parity is not added in TX frames"]
NOPARITY = 0,
#[doc = "1: Parity is added TX frames"]
PARITY = 1,
}
impl From<PARITY_A> for bool {
#[inline(always)]
fn from(variant: PARITY_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `PARITY` reader - Adding parity or not in the frame"]
pub struct PARITY_R(crate::FieldReader<bool, PARITY_A>);
impl PARITY_R {
pub(crate) fn new(bits: bool) -> Self {
PARITY_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PARITY_A {
match self.bits {
false => PARITY_A::NOPARITY,
true => PARITY_A::PARITY,
}
}
#[doc = "Checks if the value of the field is `NOPARITY`"]
#[inline(always)]
pub fn is_no_parity(&self) -> bool {
**self == PARITY_A::NOPARITY
}
#[doc = "Checks if the value of the field is `PARITY`"]
#[inline(always)]
pub fn is_parity(&self) -> bool {
**self == PARITY_A::PARITY
}
}
impl core::ops::Deref for PARITY_R {
type Target = crate::FieldReader<bool, PARITY_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PARITY` writer - Adding parity or not in the frame"]
pub struct PARITY_W<'a> {
w: &'a mut W,
}
impl<'a> PARITY_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PARITY_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Parity is not added in TX frames"]
#[inline(always)]
pub fn no_parity(self) -> &'a mut W {
self.variant(PARITY_A::NOPARITY)
}
#[doc = "Parity is added TX frames"]
#[inline(always)]
pub fn parity(self) -> &'a mut W {
self.variant(PARITY_A::PARITY)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
#[doc = "Discarding unused bits in start or at end of a Frame\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DISCARDMODE_A {
#[doc = "0: Unused bits is discarded at end of frame"]
DISCARDEND = 0,
#[doc = "1: Unused bits is discarded at start of frame"]
DISCARDSTART = 1,
}
impl From<DISCARDMODE_A> for bool {
#[inline(always)]
fn from(variant: DISCARDMODE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `DISCARDMODE` reader - Discarding unused bits in start or at end of a Frame"]
pub struct DISCARDMODE_R(crate::FieldReader<bool, DISCARDMODE_A>);
impl DISCARDMODE_R {
pub(crate) fn new(bits: bool) -> Self {
DISCARDMODE_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DISCARDMODE_A {
match self.bits {
false => DISCARDMODE_A::DISCARDEND,
true => DISCARDMODE_A::DISCARDSTART,
}
}
#[doc = "Checks if the value of the field is `DISCARDEND`"]
#[inline(always)]
pub fn is_discard_end(&self) -> bool {
**self == DISCARDMODE_A::DISCARDEND
}
#[doc = "Checks if the value of the field is `DISCARDSTART`"]
#[inline(always)]
pub fn is_discard_start(&self) -> bool {
**self == DISCARDMODE_A::DISCARDSTART
}
}
impl core::ops::Deref for DISCARDMODE_R {
type Target = crate::FieldReader<bool, DISCARDMODE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `DISCARDMODE` writer - Discarding unused bits in start or at end of a Frame"]
pub struct DISCARDMODE_W<'a> {
w: &'a mut W,
}
impl<'a> DISCARDMODE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: DISCARDMODE_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Unused bits is discarded at end of frame"]
#[inline(always)]
pub fn discard_end(self) -> &'a mut W {
self.variant(DISCARDMODE_A::DISCARDEND)
}
#[doc = "Unused bits is discarded at start of frame"]
#[inline(always)]
pub fn discard_start(self) -> &'a mut W {
self.variant(DISCARDMODE_A::DISCARDSTART)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Adding SoF or not in TX frames\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SOF_A {
#[doc = "0: Start of Frame symbol not added"]
NOSOF = 0,
#[doc = "1: Start of Frame symbol added"]
SOF = 1,
}
impl From<SOF_A> for bool {
#[inline(always)]
fn from(variant: SOF_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `SOF` reader - Adding SoF or not in TX frames"]
pub struct SOF_R(crate::FieldReader<bool, SOF_A>);
impl SOF_R {
pub(crate) fn new(bits: bool) -> Self {
SOF_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SOF_A {
match self.bits {
false => SOF_A::NOSOF,
true => SOF_A::SOF,
}
}
#[doc = "Checks if the value of the field is `NOSOF`"]
#[inline(always)]
pub fn is_no_so_f(&self) -> bool {
**self == SOF_A::NOSOF
}
#[doc = "Checks if the value of the field is `SOF`"]
#[inline(always)]
pub fn is_so_f(&self) -> bool {
**self == SOF_A::SOF
}
}
impl core::ops::Deref for SOF_R {
type Target = crate::FieldReader<bool, SOF_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SOF` writer - Adding SoF or not in TX frames"]
pub struct SOF_W<'a> {
w: &'a mut W,
}
impl<'a> SOF_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SOF_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Start of Frame symbol not added"]
#[inline(always)]
pub fn no_so_f(self) -> &'a mut W {
self.variant(SOF_A::NOSOF)
}
#[doc = "Start of Frame symbol added"]
#[inline(always)]
pub fn so_f(self) -> &'a mut W {
self.variant(SOF_A::SOF)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "CRC mode for outgoing frames\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CRCMODETX_A {
#[doc = "0: CRC is not added to the frame"]
NOCRCTX = 0,
#[doc = "1: 16 bit CRC added to the frame based on all the data read from RAM that is used in the frame"]
CRC16TX = 1,
}
impl From<CRCMODETX_A> for bool {
#[inline(always)]
fn from(variant: CRCMODETX_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CRCMODETX` reader - CRC mode for outgoing frames"]
pub struct CRCMODETX_R(crate::FieldReader<bool, CRCMODETX_A>);
impl CRCMODETX_R {
pub(crate) fn new(bits: bool) -> Self {
CRCMODETX_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> CRCMODETX_A {
match self.bits {
false => CRCMODETX_A::NOCRCTX,
true => CRCMODETX_A::CRC16TX,
}
}
#[doc = "Checks if the value of the field is `NOCRCTX`"]
#[inline(always)]
pub fn is_no_crctx(&self) -> bool {
**self == CRCMODETX_A::NOCRCTX
}
#[doc = "Checks if the value of the field is `CRC16TX`"]
#[inline(always)]
pub fn is_crc16tx(&self) -> bool {
**self == CRCMODETX_A::CRC16TX
}
}
impl core::ops::Deref for CRCMODETX_R {
type Target = crate::FieldReader<bool, CRCMODETX_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CRCMODETX` writer - CRC mode for outgoing frames"]
pub struct CRCMODETX_W<'a> {
w: &'a mut W,
}
impl<'a> CRCMODETX_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CRCMODETX_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "CRC is not added to the frame"]
#[inline(always)]
pub fn no_crctx(self) -> &'a mut W {
self.variant(CRCMODETX_A::NOCRCTX)
}
#[doc = "16 bit CRC added to the frame based on all the data read from RAM that is used in the frame"]
#[inline(always)]
pub fn crc16tx(self) -> &'a mut W {
self.variant(CRCMODETX_A::CRC16TX)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
self.w
}
}
impl R {
#[doc = "Bit 0 - Adding parity or not in the frame"]
#[inline(always)]
pub fn parity(&self) -> PARITY_R {
PARITY_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Discarding unused bits in start or at end of a Frame"]
#[inline(always)]
pub fn discardmode(&self) -> DISCARDMODE_R {
DISCARDMODE_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Adding SoF or not in TX frames"]
#[inline(always)]
pub fn sof(&self) -> SOF_R {
SOF_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 4 - CRC mode for outgoing frames"]
#[inline(always)]
pub fn crcmodetx(&self) -> CRCMODETX_R {
CRCMODETX_R::new(((self.bits >> 4) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Adding parity or not in the frame"]
#[inline(always)]
pub fn parity(&mut self) -> PARITY_W {
PARITY_W { w: self }
}
#[doc = "Bit 1 - Discarding unused bits in start or at end of a Frame"]
#[inline(always)]
pub fn discardmode(&mut self) -> DISCARDMODE_W {
DISCARDMODE_W { w: self }
}
#[doc = "Bit 2 - Adding SoF or not in TX frames"]
#[inline(always)]
pub fn sof(&mut self) -> SOF_W {
SOF_W { w: self }
}
#[doc = "Bit 4 - CRC mode for outgoing frames"]
#[inline(always)]
pub fn crcmodetx(&mut self) -> CRCMODETX_W {
CRCMODETX_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Configuration of outgoing frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frameconfig](index.html) module"]
pub struct FRAMECONFIG_SPEC;
impl crate::RegisterSpec for FRAMECONFIG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [frameconfig::R](R) reader structure"]
impl crate::Readable for FRAMECONFIG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [frameconfig::W](W) writer structure"]
impl crate::Writable for FRAMECONFIG_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets FRAMECONFIG to value 0x17"]
impl crate::Resettable for FRAMECONFIG_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x17
}
}