s32k118: rewrite everything for s32k118
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
@ -1,226 +1,112 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
#[doc = r" Value to write to the register"]
|
||||
pub struct W {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::CCR {
|
||||
#[doc = r" Modifies the contents of the register"]
|
||||
#[inline]
|
||||
pub fn modify<F>(&self, f: F)
|
||||
where
|
||||
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
|
||||
{
|
||||
let bits = self.register.get();
|
||||
let r = R { bits: bits };
|
||||
let mut w = W { bits: bits };
|
||||
f(&r, &mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
#[doc = r" Writes to the register"]
|
||||
#[inline]
|
||||
pub fn write<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(&mut W) -> &mut W,
|
||||
{
|
||||
let mut w = W::reset_value();
|
||||
f(&mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Writes the reset value to the register"]
|
||||
#[inline]
|
||||
pub fn reset(&self) {
|
||||
self.write(|w| w)
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct SCKDIVR {
|
||||
bits: u8,
|
||||
}
|
||||
impl SCKDIVR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct DBTR {
|
||||
bits: u8,
|
||||
}
|
||||
impl DBTR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct PCSSCKR {
|
||||
bits: u8,
|
||||
}
|
||||
impl PCSSCKR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct SCKPCSR {
|
||||
bits: u8,
|
||||
}
|
||||
impl SCKPCSR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _SCKDIVW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _SCKDIVW<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u8) -> &'a mut W {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 0;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _DBTW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _DBTW<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u8) -> &'a mut W {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 8;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _PCSSCKW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _PCSSCKW<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u8) -> &'a mut W {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 16;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _SCKPCSW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _SCKPCSW<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u8) -> &'a mut W {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 24;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:7 - SCK Divider"]
|
||||
#[inline]
|
||||
pub fn sckdiv(&self) -> SCKDIVR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
SCKDIVR { bits }
|
||||
}
|
||||
#[doc = "Bits 8:15 - Delay Between Transfers"]
|
||||
#[inline]
|
||||
pub fn dbt(&self) -> DBTR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 8;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
DBTR { bits }
|
||||
}
|
||||
#[doc = "Bits 16:23 - PCS to SCK Delay"]
|
||||
#[inline]
|
||||
pub fn pcssck(&self) -> PCSSCKR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 16;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
PCSSCKR { bits }
|
||||
}
|
||||
#[doc = "Bits 24:31 - SCK to PCS Delay"]
|
||||
#[inline]
|
||||
pub fn sckpcs(&self) -> SCKPCSR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 24;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
SCKPCSR { bits }
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = r" Reset value of the register"]
|
||||
#[inline]
|
||||
pub fn reset_value() -> W {
|
||||
W { bits: 0 }
|
||||
}
|
||||
#[doc = r" Writes raw bits to the register"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.bits = bits;
|
||||
self
|
||||
}
|
||||
#[doc = "Bits 0:7 - SCK Divider"]
|
||||
#[inline]
|
||||
pub fn sckdiv(&mut self) -> _SCKDIVW {
|
||||
_SCKDIVW { w: self }
|
||||
}
|
||||
#[doc = "Bits 8:15 - Delay Between Transfers"]
|
||||
#[inline]
|
||||
pub fn dbt(&mut self) -> _DBTW {
|
||||
_DBTW { w: self }
|
||||
}
|
||||
#[doc = "Bits 16:23 - PCS to SCK Delay"]
|
||||
#[inline]
|
||||
pub fn pcssck(&mut self) -> _PCSSCKW {
|
||||
_PCSSCKW { w: self }
|
||||
}
|
||||
#[doc = "Bits 24:31 - SCK to PCS Delay"]
|
||||
#[inline]
|
||||
pub fn sckpcs(&mut self) -> _SCKPCSW {
|
||||
_SCKPCSW { w: self }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register CCR"]
|
||||
pub type R = crate::R<u32, super::CCR>;
|
||||
#[doc = "Writer for register CCR"]
|
||||
pub type W = crate::W<u32, super::CCR>;
|
||||
#[doc = "Register CCR `reset()`'s with value 0"]
|
||||
impl crate::ResetValue for super::CCR {
|
||||
type Type = u32;
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Type {
|
||||
0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `SCKDIV`"]
|
||||
pub type SCKDIV_R = crate::R<u8, u8>;
|
||||
#[doc = "Write proxy for field `SCKDIV`"]
|
||||
pub struct SCKDIV_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> SCKDIV_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 = "Reader of field `DBT`"]
|
||||
pub type DBT_R = crate::R<u8, u8>;
|
||||
#[doc = "Write proxy for field `DBT`"]
|
||||
pub struct DBT_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> DBT_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 = "Reader of field `PCSSCK`"]
|
||||
pub type PCSSCK_R = crate::R<u8, u8>;
|
||||
#[doc = "Write proxy for field `PCSSCK`"]
|
||||
pub struct PCSSCK_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> PCSSCK_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 = "Reader of field `SCKPCS`"]
|
||||
pub type SCKPCS_R = crate::R<u8, u8>;
|
||||
#[doc = "Write proxy for field `SCKPCS`"]
|
||||
pub struct SCKPCS_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> SCKPCS_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 - SCK Divider"]
|
||||
#[inline(always)]
|
||||
pub fn sckdiv(&self) -> SCKDIV_R {
|
||||
SCKDIV_R::new((self.bits & 0xff) as u8)
|
||||
}
|
||||
#[doc = "Bits 8:15 - Delay Between Transfers"]
|
||||
#[inline(always)]
|
||||
pub fn dbt(&self) -> DBT_R {
|
||||
DBT_R::new(((self.bits >> 8) & 0xff) as u8)
|
||||
}
|
||||
#[doc = "Bits 16:23 - PCS to SCK Delay"]
|
||||
#[inline(always)]
|
||||
pub fn pcssck(&self) -> PCSSCK_R {
|
||||
PCSSCK_R::new(((self.bits >> 16) & 0xff) as u8)
|
||||
}
|
||||
#[doc = "Bits 24:31 - SCK to PCS Delay"]
|
||||
#[inline(always)]
|
||||
pub fn sckpcs(&self) -> SCKPCS_R {
|
||||
SCKPCS_R::new(((self.bits >> 24) & 0xff) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:7 - SCK Divider"]
|
||||
#[inline(always)]
|
||||
pub fn sckdiv(&mut self) -> SCKDIV_W {
|
||||
SCKDIV_W { w: self }
|
||||
}
|
||||
#[doc = "Bits 8:15 - Delay Between Transfers"]
|
||||
#[inline(always)]
|
||||
pub fn dbt(&mut self) -> DBT_W {
|
||||
DBT_W { w: self }
|
||||
}
|
||||
#[doc = "Bits 16:23 - PCS to SCK Delay"]
|
||||
#[inline(always)]
|
||||
pub fn pcssck(&mut self) -> PCSSCK_W {
|
||||
PCSSCK_W { w: self }
|
||||
}
|
||||
#[doc = "Bits 24:31 - SCK to PCS Delay"]
|
||||
#[inline(always)]
|
||||
pub fn sckpcs(&mut self) -> SCKPCS_W {
|
||||
SCKPCS_W { w: self }
|
||||
}
|
||||
}
|
||||
|
1098
src/lpspi1/cfgr0.rs
1098
src/lpspi1/cfgr0.rs
File diff suppressed because it is too large
Load Diff
1625
src/lpspi1/cfgr1.rs
1625
src/lpspi1/cfgr1.rs
File diff suppressed because it is too large
Load Diff
1136
src/lpspi1/cr.rs
1136
src/lpspi1/cr.rs
File diff suppressed because it is too large
Load Diff
@ -1,300 +1,186 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
#[doc = r" Value to write to the register"]
|
||||
pub struct W {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::DER {
|
||||
#[doc = r" Modifies the contents of the register"]
|
||||
#[inline]
|
||||
pub fn modify<F>(&self, f: F)
|
||||
where
|
||||
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
|
||||
{
|
||||
let bits = self.register.get();
|
||||
let r = R { bits: bits };
|
||||
let mut w = W { bits: bits };
|
||||
f(&r, &mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
#[doc = r" Writes to the register"]
|
||||
#[inline]
|
||||
pub fn write<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(&mut W) -> &mut W,
|
||||
{
|
||||
let mut w = W::reset_value();
|
||||
f(&mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Writes the reset value to the register"]
|
||||
#[inline]
|
||||
pub fn reset(&self) {
|
||||
self.write(|w| w)
|
||||
}
|
||||
}
|
||||
#[doc = "Possible values of the field `TDDE`"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum TDDER {
|
||||
#[doc = "DMA request disabled."]
|
||||
_0,
|
||||
#[doc = "DMA request enabled"]
|
||||
_1,
|
||||
}
|
||||
impl TDDER {
|
||||
#[doc = r" Returns `true` if the bit is clear (0)"]
|
||||
#[inline]
|
||||
pub fn bit_is_clear(&self) -> bool {
|
||||
!self.bit()
|
||||
}
|
||||
#[doc = r" Returns `true` if the bit is set (1)"]
|
||||
#[inline]
|
||||
pub fn bit_is_set(&self) -> bool {
|
||||
self.bit()
|
||||
}
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bit(&self) -> bool {
|
||||
match *self {
|
||||
TDDER::_0 => false,
|
||||
TDDER::_1 => true,
|
||||
}
|
||||
}
|
||||
#[allow(missing_docs)]
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
pub fn _from(value: bool) -> TDDER {
|
||||
match value {
|
||||
false => TDDER::_0,
|
||||
true => TDDER::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == TDDER::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == TDDER::_1
|
||||
}
|
||||
}
|
||||
#[doc = "Possible values of the field `RDDE`"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum RDDER {
|
||||
#[doc = "DMA request disabled."]
|
||||
_0,
|
||||
#[doc = "DMA request enabled."]
|
||||
_1,
|
||||
}
|
||||
impl RDDER {
|
||||
#[doc = r" Returns `true` if the bit is clear (0)"]
|
||||
#[inline]
|
||||
pub fn bit_is_clear(&self) -> bool {
|
||||
!self.bit()
|
||||
}
|
||||
#[doc = r" Returns `true` if the bit is set (1)"]
|
||||
#[inline]
|
||||
pub fn bit_is_set(&self) -> bool {
|
||||
self.bit()
|
||||
}
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bit(&self) -> bool {
|
||||
match *self {
|
||||
RDDER::_0 => false,
|
||||
RDDER::_1 => true,
|
||||
}
|
||||
}
|
||||
#[allow(missing_docs)]
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
pub fn _from(value: bool) -> RDDER {
|
||||
match value {
|
||||
false => RDDER::_0,
|
||||
true => RDDER::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == RDDER::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == RDDER::_1
|
||||
}
|
||||
}
|
||||
#[doc = "Values that can be written to the field `TDDE`"]
|
||||
pub enum TDDEW {
|
||||
#[doc = "DMA request disabled."]
|
||||
_0,
|
||||
#[doc = "DMA request enabled"]
|
||||
_1,
|
||||
}
|
||||
impl TDDEW {
|
||||
#[allow(missing_docs)]
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
pub fn _bits(&self) -> bool {
|
||||
match *self {
|
||||
TDDEW::_0 => false,
|
||||
TDDEW::_1 => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _TDDEW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _TDDEW<'a> {
|
||||
#[doc = r" Writes `variant` to the field"]
|
||||
#[inline]
|
||||
pub fn variant(self, variant: TDDEW) -> &'a mut W {
|
||||
{
|
||||
self.bit(variant._bits())
|
||||
}
|
||||
}
|
||||
#[doc = "DMA request disabled."]
|
||||
#[inline]
|
||||
pub fn _0(self) -> &'a mut W {
|
||||
self.variant(TDDEW::_0)
|
||||
}
|
||||
#[doc = "DMA request enabled"]
|
||||
#[inline]
|
||||
pub fn _1(self) -> &'a mut W {
|
||||
self.variant(TDDEW::_1)
|
||||
}
|
||||
#[doc = r" Sets the field bit"]
|
||||
pub fn set_bit(self) -> &'a mut W {
|
||||
self.bit(true)
|
||||
}
|
||||
#[doc = r" Clears the field bit"]
|
||||
pub fn clear_bit(self) -> &'a mut W {
|
||||
self.bit(false)
|
||||
}
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub fn bit(self, value: bool) -> &'a mut W {
|
||||
const MASK: bool = true;
|
||||
const OFFSET: u8 = 0;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
#[doc = "Values that can be written to the field `RDDE`"]
|
||||
pub enum RDDEW {
|
||||
#[doc = "DMA request disabled."]
|
||||
_0,
|
||||
#[doc = "DMA request enabled."]
|
||||
_1,
|
||||
}
|
||||
impl RDDEW {
|
||||
#[allow(missing_docs)]
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
pub fn _bits(&self) -> bool {
|
||||
match *self {
|
||||
RDDEW::_0 => false,
|
||||
RDDEW::_1 => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _RDDEW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _RDDEW<'a> {
|
||||
#[doc = r" Writes `variant` to the field"]
|
||||
#[inline]
|
||||
pub fn variant(self, variant: RDDEW) -> &'a mut W {
|
||||
{
|
||||
self.bit(variant._bits())
|
||||
}
|
||||
}
|
||||
#[doc = "DMA request disabled."]
|
||||
#[inline]
|
||||
pub fn _0(self) -> &'a mut W {
|
||||
self.variant(RDDEW::_0)
|
||||
}
|
||||
#[doc = "DMA request enabled."]
|
||||
#[inline]
|
||||
pub fn _1(self) -> &'a mut W {
|
||||
self.variant(RDDEW::_1)
|
||||
}
|
||||
#[doc = r" Sets the field bit"]
|
||||
pub fn set_bit(self) -> &'a mut W {
|
||||
self.bit(true)
|
||||
}
|
||||
#[doc = r" Clears the field bit"]
|
||||
pub fn clear_bit(self) -> &'a mut W {
|
||||
self.bit(false)
|
||||
}
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub fn bit(self, value: bool) -> &'a mut W {
|
||||
const MASK: bool = true;
|
||||
const OFFSET: u8 = 1;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bit 0 - Transmit Data DMA Enable"]
|
||||
#[inline]
|
||||
pub fn tdde(&self) -> TDDER {
|
||||
TDDER::_from({
|
||||
const MASK: bool = true;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) != 0
|
||||
})
|
||||
}
|
||||
#[doc = "Bit 1 - Receive Data DMA Enable"]
|
||||
#[inline]
|
||||
pub fn rdde(&self) -> RDDER {
|
||||
RDDER::_from({
|
||||
const MASK: bool = true;
|
||||
const OFFSET: u8 = 1;
|
||||
((self.bits >> OFFSET) & MASK as u32) != 0
|
||||
})
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = r" Reset value of the register"]
|
||||
#[inline]
|
||||
pub fn reset_value() -> W {
|
||||
W { bits: 0 }
|
||||
}
|
||||
#[doc = r" Writes raw bits to the register"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.bits = bits;
|
||||
self
|
||||
}
|
||||
#[doc = "Bit 0 - Transmit Data DMA Enable"]
|
||||
#[inline]
|
||||
pub fn tdde(&mut self) -> _TDDEW {
|
||||
_TDDEW { w: self }
|
||||
}
|
||||
#[doc = "Bit 1 - Receive Data DMA Enable"]
|
||||
#[inline]
|
||||
pub fn rdde(&mut self) -> _RDDEW {
|
||||
_RDDEW { w: self }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register DER"]
|
||||
pub type R = crate::R<u32, super::DER>;
|
||||
#[doc = "Writer for register DER"]
|
||||
pub type W = crate::W<u32, super::DER>;
|
||||
#[doc = "Register DER `reset()`'s with value 0"]
|
||||
impl crate::ResetValue for super::DER {
|
||||
type Type = u32;
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Type {
|
||||
0
|
||||
}
|
||||
}
|
||||
#[doc = "Transmit Data DMA Enable\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum TDDE_A {
|
||||
#[doc = "0: DMA request disabled."]
|
||||
_0 = 0,
|
||||
#[doc = "1: DMA request enabled"]
|
||||
_1 = 1,
|
||||
}
|
||||
impl From<TDDE_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: TDDE_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `TDDE`"]
|
||||
pub type TDDE_R = crate::R<bool, TDDE_A>;
|
||||
impl TDDE_R {
|
||||
#[doc = r"Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> TDDE_A {
|
||||
match self.bits {
|
||||
false => TDDE_A::_0,
|
||||
true => TDDE_A::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline(always)]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == TDDE_A::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline(always)]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == TDDE_A::_1
|
||||
}
|
||||
}
|
||||
#[doc = "Write proxy for field `TDDE`"]
|
||||
pub struct TDDE_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> TDDE_W<'a> {
|
||||
#[doc = r"Writes `variant` to the field"]
|
||||
#[inline(always)]
|
||||
pub fn variant(self, variant: TDDE_A) -> &'a mut W {
|
||||
{
|
||||
self.bit(variant.into())
|
||||
}
|
||||
}
|
||||
#[doc = "DMA request disabled."]
|
||||
#[inline(always)]
|
||||
pub fn _0(self) -> &'a mut W {
|
||||
self.variant(TDDE_A::_0)
|
||||
}
|
||||
#[doc = "DMA request enabled"]
|
||||
#[inline(always)]
|
||||
pub fn _1(self) -> &'a mut W {
|
||||
self.variant(TDDE_A::_1)
|
||||
}
|
||||
#[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 = "Receive Data DMA Enable\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum RDDE_A {
|
||||
#[doc = "0: DMA request disabled."]
|
||||
_0 = 0,
|
||||
#[doc = "1: DMA request enabled."]
|
||||
_1 = 1,
|
||||
}
|
||||
impl From<RDDE_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: RDDE_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `RDDE`"]
|
||||
pub type RDDE_R = crate::R<bool, RDDE_A>;
|
||||
impl RDDE_R {
|
||||
#[doc = r"Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> RDDE_A {
|
||||
match self.bits {
|
||||
false => RDDE_A::_0,
|
||||
true => RDDE_A::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline(always)]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == RDDE_A::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline(always)]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == RDDE_A::_1
|
||||
}
|
||||
}
|
||||
#[doc = "Write proxy for field `RDDE`"]
|
||||
pub struct RDDE_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> RDDE_W<'a> {
|
||||
#[doc = r"Writes `variant` to the field"]
|
||||
#[inline(always)]
|
||||
pub fn variant(self, variant: RDDE_A) -> &'a mut W {
|
||||
{
|
||||
self.bit(variant.into())
|
||||
}
|
||||
}
|
||||
#[doc = "DMA request disabled."]
|
||||
#[inline(always)]
|
||||
pub fn _0(self) -> &'a mut W {
|
||||
self.variant(RDDE_A::_0)
|
||||
}
|
||||
#[doc = "DMA request enabled."]
|
||||
#[inline(always)]
|
||||
pub fn _1(self) -> &'a mut W {
|
||||
self.variant(RDDE_A::_1)
|
||||
}
|
||||
#[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 - Transmit Data DMA Enable"]
|
||||
#[inline(always)]
|
||||
pub fn tdde(&self) -> TDDE_R {
|
||||
TDDE_R::new((self.bits & 0x01) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Receive Data DMA Enable"]
|
||||
#[inline(always)]
|
||||
pub fn rdde(&self) -> RDDE_R {
|
||||
RDDE_R::new(((self.bits >> 1) & 0x01) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Transmit Data DMA Enable"]
|
||||
#[inline(always)]
|
||||
pub fn tdde(&mut self) -> TDDE_W {
|
||||
TDDE_W { w: self }
|
||||
}
|
||||
#[doc = "Bit 1 - Receive Data DMA Enable"]
|
||||
#[inline(always)]
|
||||
pub fn rdde(&mut self) -> RDDE_W {
|
||||
RDDE_W { w: self }
|
||||
}
|
||||
}
|
||||
|
@ -1,103 +1,40 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
#[doc = r" Value to write to the register"]
|
||||
pub struct W {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::DMR0 {
|
||||
#[doc = r" Modifies the contents of the register"]
|
||||
#[inline]
|
||||
pub fn modify<F>(&self, f: F)
|
||||
where
|
||||
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
|
||||
{
|
||||
let bits = self.register.get();
|
||||
let r = R { bits: bits };
|
||||
let mut w = W { bits: bits };
|
||||
f(&r, &mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
#[doc = r" Writes to the register"]
|
||||
#[inline]
|
||||
pub fn write<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(&mut W) -> &mut W,
|
||||
{
|
||||
let mut w = W::reset_value();
|
||||
f(&mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Writes the reset value to the register"]
|
||||
#[inline]
|
||||
pub fn reset(&self) {
|
||||
self.write(|w| w)
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct MATCH0R {
|
||||
bits: u32,
|
||||
}
|
||||
impl MATCH0R {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _MATCH0W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _MATCH0W<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u32) -> &'a mut W {
|
||||
const MASK: u32 = 4294967295;
|
||||
const OFFSET: u8 = 0;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:31 - Match 0 Value"]
|
||||
#[inline]
|
||||
pub fn match0(&self) -> MATCH0R {
|
||||
let bits = {
|
||||
const MASK: u32 = 4294967295;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u32
|
||||
};
|
||||
MATCH0R { bits }
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = r" Reset value of the register"]
|
||||
#[inline]
|
||||
pub fn reset_value() -> W {
|
||||
W { bits: 0 }
|
||||
}
|
||||
#[doc = r" Writes raw bits to the register"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.bits = bits;
|
||||
self
|
||||
}
|
||||
#[doc = "Bits 0:31 - Match 0 Value"]
|
||||
#[inline]
|
||||
pub fn match0(&mut self) -> _MATCH0W {
|
||||
_MATCH0W { w: self }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register DMR0"]
|
||||
pub type R = crate::R<u32, super::DMR0>;
|
||||
#[doc = "Writer for register DMR0"]
|
||||
pub type W = crate::W<u32, super::DMR0>;
|
||||
#[doc = "Register DMR0 `reset()`'s with value 0"]
|
||||
impl crate::ResetValue for super::DMR0 {
|
||||
type Type = u32;
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Type {
|
||||
0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `MATCH0`"]
|
||||
pub type MATCH0_R = crate::R<u32, u32>;
|
||||
#[doc = "Write proxy for field `MATCH0`"]
|
||||
pub struct MATCH0_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> MATCH0_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 - Match 0 Value"]
|
||||
#[inline(always)]
|
||||
pub fn match0(&self) -> MATCH0_R {
|
||||
MATCH0_R::new((self.bits & 0xffff_ffff) as u32)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:31 - Match 0 Value"]
|
||||
#[inline(always)]
|
||||
pub fn match0(&mut self) -> MATCH0_W {
|
||||
MATCH0_W { w: self }
|
||||
}
|
||||
}
|
||||
|
@ -1,103 +1,40 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
#[doc = r" Value to write to the register"]
|
||||
pub struct W {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::DMR1 {
|
||||
#[doc = r" Modifies the contents of the register"]
|
||||
#[inline]
|
||||
pub fn modify<F>(&self, f: F)
|
||||
where
|
||||
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
|
||||
{
|
||||
let bits = self.register.get();
|
||||
let r = R { bits: bits };
|
||||
let mut w = W { bits: bits };
|
||||
f(&r, &mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
#[doc = r" Writes to the register"]
|
||||
#[inline]
|
||||
pub fn write<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(&mut W) -> &mut W,
|
||||
{
|
||||
let mut w = W::reset_value();
|
||||
f(&mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Writes the reset value to the register"]
|
||||
#[inline]
|
||||
pub fn reset(&self) {
|
||||
self.write(|w| w)
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct MATCH1R {
|
||||
bits: u32,
|
||||
}
|
||||
impl MATCH1R {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _MATCH1W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _MATCH1W<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u32) -> &'a mut W {
|
||||
const MASK: u32 = 4294967295;
|
||||
const OFFSET: u8 = 0;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:31 - Match 1 Value"]
|
||||
#[inline]
|
||||
pub fn match1(&self) -> MATCH1R {
|
||||
let bits = {
|
||||
const MASK: u32 = 4294967295;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u32
|
||||
};
|
||||
MATCH1R { bits }
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = r" Reset value of the register"]
|
||||
#[inline]
|
||||
pub fn reset_value() -> W {
|
||||
W { bits: 0 }
|
||||
}
|
||||
#[doc = r" Writes raw bits to the register"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.bits = bits;
|
||||
self
|
||||
}
|
||||
#[doc = "Bits 0:31 - Match 1 Value"]
|
||||
#[inline]
|
||||
pub fn match1(&mut self) -> _MATCH1W {
|
||||
_MATCH1W { w: self }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register DMR1"]
|
||||
pub type R = crate::R<u32, super::DMR1>;
|
||||
#[doc = "Writer for register DMR1"]
|
||||
pub type W = crate::W<u32, super::DMR1>;
|
||||
#[doc = "Register DMR1 `reset()`'s with value 0"]
|
||||
impl crate::ResetValue for super::DMR1 {
|
||||
type Type = u32;
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Type {
|
||||
0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `MATCH1`"]
|
||||
pub type MATCH1_R = crate::R<u32, u32>;
|
||||
#[doc = "Write proxy for field `MATCH1`"]
|
||||
pub struct MATCH1_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> MATCH1_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 - Match 1 Value"]
|
||||
#[inline(always)]
|
||||
pub fn match1(&self) -> MATCH1_R {
|
||||
MATCH1_R::new((self.bits & 0xffff_ffff) as u32)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:31 - Match 1 Value"]
|
||||
#[inline(always)]
|
||||
pub fn match1(&mut self) -> MATCH1_W {
|
||||
MATCH1_W { w: self }
|
||||
}
|
||||
}
|
||||
|
@ -1,144 +1,64 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
#[doc = r" Value to write to the register"]
|
||||
pub struct W {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::FCR {
|
||||
#[doc = r" Modifies the contents of the register"]
|
||||
#[inline]
|
||||
pub fn modify<F>(&self, f: F)
|
||||
where
|
||||
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
|
||||
{
|
||||
let bits = self.register.get();
|
||||
let r = R { bits: bits };
|
||||
let mut w = W { bits: bits };
|
||||
f(&r, &mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
#[doc = r" Writes to the register"]
|
||||
#[inline]
|
||||
pub fn write<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(&mut W) -> &mut W,
|
||||
{
|
||||
let mut w = W::reset_value();
|
||||
f(&mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
#[doc = r" Writes the reset value to the register"]
|
||||
#[inline]
|
||||
pub fn reset(&self) {
|
||||
self.write(|w| w)
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct TXWATERR {
|
||||
bits: u8,
|
||||
}
|
||||
impl TXWATERR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct RXWATERR {
|
||||
bits: u8,
|
||||
}
|
||||
impl RXWATERR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _TXWATERW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _TXWATERW<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u8) -> &'a mut W {
|
||||
const MASK: u8 = 3;
|
||||
const OFFSET: u8 = 0;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _RXWATERW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _RXWATERW<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u8) -> &'a mut W {
|
||||
const MASK: u8 = 3;
|
||||
const OFFSET: u8 = 16;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:1 - Transmit FIFO Watermark"]
|
||||
#[inline]
|
||||
pub fn txwater(&self) -> TXWATERR {
|
||||
let bits = {
|
||||
const MASK: u8 = 3;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
TXWATERR { bits }
|
||||
}
|
||||
#[doc = "Bits 16:17 - Receive FIFO Watermark"]
|
||||
#[inline]
|
||||
pub fn rxwater(&self) -> RXWATERR {
|
||||
let bits = {
|
||||
const MASK: u8 = 3;
|
||||
const OFFSET: u8 = 16;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
RXWATERR { bits }
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = r" Reset value of the register"]
|
||||
#[inline]
|
||||
pub fn reset_value() -> W {
|
||||
W { bits: 0 }
|
||||
}
|
||||
#[doc = r" Writes raw bits to the register"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.bits = bits;
|
||||
self
|
||||
}
|
||||
#[doc = "Bits 0:1 - Transmit FIFO Watermark"]
|
||||
#[inline]
|
||||
pub fn txwater(&mut self) -> _TXWATERW {
|
||||
_TXWATERW { w: self }
|
||||
}
|
||||
#[doc = "Bits 16:17 - Receive FIFO Watermark"]
|
||||
#[inline]
|
||||
pub fn rxwater(&mut self) -> _RXWATERW {
|
||||
_RXWATERW { w: self }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register FCR"]
|
||||
pub type R = crate::R<u32, super::FCR>;
|
||||
#[doc = "Writer for register FCR"]
|
||||
pub type W = crate::W<u32, super::FCR>;
|
||||
#[doc = "Register FCR `reset()`'s with value 0"]
|
||||
impl crate::ResetValue for super::FCR {
|
||||
type Type = u32;
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Type {
|
||||
0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `TXWATER`"]
|
||||
pub type TXWATER_R = crate::R<u8, u8>;
|
||||
#[doc = "Write proxy for field `TXWATER`"]
|
||||
pub struct TXWATER_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> TXWATER_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 = "Reader of field `RXWATER`"]
|
||||
pub type RXWATER_R = crate::R<u8, u8>;
|
||||
#[doc = "Write proxy for field `RXWATER`"]
|
||||
pub struct RXWATER_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> RXWATER_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 << 16)) | (((value as u32) & 0x03) << 16);
|
||||
self.w
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bits 0:1 - Transmit FIFO Watermark"]
|
||||
#[inline(always)]
|
||||
pub fn txwater(&self) -> TXWATER_R {
|
||||
TXWATER_R::new((self.bits & 0x03) as u8)
|
||||
}
|
||||
#[doc = "Bits 16:17 - Receive FIFO Watermark"]
|
||||
#[inline(always)]
|
||||
pub fn rxwater(&self) -> RXWATER_R {
|
||||
RXWATER_R::new(((self.bits >> 16) & 0x03) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:1 - Transmit FIFO Watermark"]
|
||||
#[inline(always)]
|
||||
pub fn txwater(&mut self) -> TXWATER_W {
|
||||
TXWATER_W { w: self }
|
||||
}
|
||||
#[doc = "Bits 16:17 - Receive FIFO Watermark"]
|
||||
#[inline(always)]
|
||||
pub fn rxwater(&mut self) -> RXWATER_W {
|
||||
RXWATER_W { w: self }
|
||||
}
|
||||
}
|
||||
|
@ -1,60 +1,18 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::FSR {
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct TXCOUNTR {
|
||||
bits: u8,
|
||||
}
|
||||
impl TXCOUNTR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct RXCOUNTR {
|
||||
bits: u8,
|
||||
}
|
||||
impl RXCOUNTR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:2 - Transmit FIFO Count"]
|
||||
#[inline]
|
||||
pub fn txcount(&self) -> TXCOUNTR {
|
||||
let bits = {
|
||||
const MASK: u8 = 7;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
TXCOUNTR { bits }
|
||||
}
|
||||
#[doc = "Bits 16:18 - Receive FIFO Count"]
|
||||
#[inline]
|
||||
pub fn rxcount(&self) -> RXCOUNTR {
|
||||
let bits = {
|
||||
const MASK: u8 = 7;
|
||||
const OFFSET: u8 = 16;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
RXCOUNTR { bits }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register FSR"]
|
||||
pub type R = crate::R<u32, super::FSR>;
|
||||
#[doc = "Reader of field `TXCOUNT`"]
|
||||
pub type TXCOUNT_R = crate::R<u8, u8>;
|
||||
#[doc = "Reader of field `RXCOUNT`"]
|
||||
pub type RXCOUNT_R = crate::R<u8, u8>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:2 - Transmit FIFO Count"]
|
||||
#[inline(always)]
|
||||
pub fn txcount(&self) -> TXCOUNT_R {
|
||||
TXCOUNT_R::new((self.bits & 0x07) as u8)
|
||||
}
|
||||
#[doc = "Bits 16:18 - Receive FIFO Count"]
|
||||
#[inline(always)]
|
||||
pub fn rxcount(&self) -> RXCOUNT_R {
|
||||
RXCOUNT_R::new(((self.bits >> 16) & 0x07) as u8)
|
||||
}
|
||||
}
|
||||
|
1710
src/lpspi1/ier.rs
1710
src/lpspi1/ier.rs
File diff suppressed because it is too large
Load Diff
@ -1,60 +1,18 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::PARAM {
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct TXFIFOR {
|
||||
bits: u8,
|
||||
}
|
||||
impl TXFIFOR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct RXFIFOR {
|
||||
bits: u8,
|
||||
}
|
||||
impl RXFIFOR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:7 - Transmit FIFO Size"]
|
||||
#[inline]
|
||||
pub fn txfifo(&self) -> TXFIFOR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
TXFIFOR { bits }
|
||||
}
|
||||
#[doc = "Bits 8:15 - Receive FIFO Size"]
|
||||
#[inline]
|
||||
pub fn rxfifo(&self) -> RXFIFOR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 8;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
RXFIFOR { bits }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register PARAM"]
|
||||
pub type R = crate::R<u32, super::PARAM>;
|
||||
#[doc = "Reader of field `TXFIFO`"]
|
||||
pub type TXFIFO_R = crate::R<u8, u8>;
|
||||
#[doc = "Reader of field `RXFIFO`"]
|
||||
pub type RXFIFO_R = crate::R<u8, u8>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:7 - Transmit FIFO Size"]
|
||||
#[inline(always)]
|
||||
pub fn txfifo(&self) -> TXFIFO_R {
|
||||
TXFIFO_R::new((self.bits & 0xff) as u8)
|
||||
}
|
||||
#[doc = "Bits 8:15 - Receive FIFO Size"]
|
||||
#[inline(always)]
|
||||
pub fn rxfifo(&self) -> RXFIFO_R {
|
||||
RXFIFO_R::new(((self.bits >> 8) & 0xff) as u8)
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,11 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::RDR {
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct DATAR {
|
||||
bits: u32,
|
||||
}
|
||||
impl DATAR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:31 - Receive Data"]
|
||||
#[inline]
|
||||
pub fn data(&self) -> DATAR {
|
||||
let bits = {
|
||||
const MASK: u32 = 4294967295;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u32
|
||||
};
|
||||
DATAR { bits }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register RDR"]
|
||||
pub type R = crate::R<u32, super::RDR>;
|
||||
#[doc = "Reader of field `DATA`"]
|
||||
pub type DATA_R = crate::R<u32, u32>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:31 - Receive Data"]
|
||||
#[inline(always)]
|
||||
pub fn data(&self) -> DATA_R {
|
||||
DATA_R::new((self.bits & 0xffff_ffff) as u32)
|
||||
}
|
||||
}
|
||||
|
@ -1,130 +1,86 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::RSR {
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
}
|
||||
#[doc = "Possible values of the field `SOF`"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum SOFR {
|
||||
#[doc = "Subsequent data word received after LPSPI_PCS assertion."]
|
||||
_0,
|
||||
#[doc = "First data word received after LPSPI_PCS assertion."]
|
||||
_1,
|
||||
}
|
||||
impl SOFR {
|
||||
#[doc = r" Returns `true` if the bit is clear (0)"]
|
||||
#[inline]
|
||||
pub fn bit_is_clear(&self) -> bool {
|
||||
!self.bit()
|
||||
}
|
||||
#[doc = r" Returns `true` if the bit is set (1)"]
|
||||
#[inline]
|
||||
pub fn bit_is_set(&self) -> bool {
|
||||
self.bit()
|
||||
}
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bit(&self) -> bool {
|
||||
match *self {
|
||||
SOFR::_0 => false,
|
||||
SOFR::_1 => true,
|
||||
}
|
||||
}
|
||||
#[allow(missing_docs)]
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
pub fn _from(value: bool) -> SOFR {
|
||||
match value {
|
||||
false => SOFR::_0,
|
||||
true => SOFR::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == SOFR::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == SOFR::_1
|
||||
}
|
||||
}
|
||||
#[doc = "Possible values of the field `RXEMPTY`"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum RXEMPTYR {
|
||||
#[doc = "RX FIFO is not empty."]
|
||||
_0,
|
||||
#[doc = "RX FIFO is empty."]
|
||||
_1,
|
||||
}
|
||||
impl RXEMPTYR {
|
||||
#[doc = r" Returns `true` if the bit is clear (0)"]
|
||||
#[inline]
|
||||
pub fn bit_is_clear(&self) -> bool {
|
||||
!self.bit()
|
||||
}
|
||||
#[doc = r" Returns `true` if the bit is set (1)"]
|
||||
#[inline]
|
||||
pub fn bit_is_set(&self) -> bool {
|
||||
self.bit()
|
||||
}
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bit(&self) -> bool {
|
||||
match *self {
|
||||
RXEMPTYR::_0 => false,
|
||||
RXEMPTYR::_1 => true,
|
||||
}
|
||||
}
|
||||
#[allow(missing_docs)]
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
pub fn _from(value: bool) -> RXEMPTYR {
|
||||
match value {
|
||||
false => RXEMPTYR::_0,
|
||||
true => RXEMPTYR::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == RXEMPTYR::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == RXEMPTYR::_1
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bit 0 - Start Of Frame"]
|
||||
#[inline]
|
||||
pub fn sof(&self) -> SOFR {
|
||||
SOFR::_from({
|
||||
const MASK: bool = true;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) != 0
|
||||
})
|
||||
}
|
||||
#[doc = "Bit 1 - RX FIFO Empty"]
|
||||
#[inline]
|
||||
pub fn rxempty(&self) -> RXEMPTYR {
|
||||
RXEMPTYR::_from({
|
||||
const MASK: bool = true;
|
||||
const OFFSET: u8 = 1;
|
||||
((self.bits >> OFFSET) & MASK as u32) != 0
|
||||
})
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register RSR"]
|
||||
pub type R = crate::R<u32, super::RSR>;
|
||||
#[doc = "Start Of Frame\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum SOF_A {
|
||||
#[doc = "0: Subsequent data word received after LPSPI_PCS assertion."]
|
||||
_0 = 0,
|
||||
#[doc = "1: First data word received after LPSPI_PCS assertion."]
|
||||
_1 = 1,
|
||||
}
|
||||
impl From<SOF_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: SOF_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `SOF`"]
|
||||
pub type SOF_R = crate::R<bool, SOF_A>;
|
||||
impl SOF_R {
|
||||
#[doc = r"Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> SOF_A {
|
||||
match self.bits {
|
||||
false => SOF_A::_0,
|
||||
true => SOF_A::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline(always)]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == SOF_A::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline(always)]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == SOF_A::_1
|
||||
}
|
||||
}
|
||||
#[doc = "RX FIFO Empty\n\nValue on reset: 1"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum RXEMPTY_A {
|
||||
#[doc = "0: RX FIFO is not empty."]
|
||||
_0 = 0,
|
||||
#[doc = "1: RX FIFO is empty."]
|
||||
_1 = 1,
|
||||
}
|
||||
impl From<RXEMPTY_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: RXEMPTY_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `RXEMPTY`"]
|
||||
pub type RXEMPTY_R = crate::R<bool, RXEMPTY_A>;
|
||||
impl RXEMPTY_R {
|
||||
#[doc = r"Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> RXEMPTY_A {
|
||||
match self.bits {
|
||||
false => RXEMPTY_A::_0,
|
||||
true => RXEMPTY_A::_1,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0`"]
|
||||
#[inline(always)]
|
||||
pub fn is_0(&self) -> bool {
|
||||
*self == RXEMPTY_A::_0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_1`"]
|
||||
#[inline(always)]
|
||||
pub fn is_1(&self) -> bool {
|
||||
*self == RXEMPTY_A::_1
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Start Of Frame"]
|
||||
#[inline(always)]
|
||||
pub fn sof(&self) -> SOF_R {
|
||||
SOF_R::new((self.bits & 0x01) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - RX FIFO Empty"]
|
||||
#[inline(always)]
|
||||
pub fn rxempty(&self) -> RXEMPTY_R {
|
||||
RXEMPTY_R::new(((self.bits >> 1) & 0x01) != 0)
|
||||
}
|
||||
}
|
||||
|
1593
src/lpspi1/sr.rs
1593
src/lpspi1/sr.rs
File diff suppressed because it is too large
Load Diff
2582
src/lpspi1/tcr.rs
2582
src/lpspi1/tcr.rs
File diff suppressed because it is too large
Load Diff
@ -1,49 +1,29 @@
|
||||
#[doc = r" Value to write to the register"]
|
||||
pub struct W {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::TDR {
|
||||
#[doc = r" Writes to the register"]
|
||||
#[inline]
|
||||
pub fn write<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(&mut W) -> &mut W,
|
||||
{
|
||||
let mut w = W::reset_value();
|
||||
f(&mut w);
|
||||
self.register.set(w.bits);
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _DATAW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _DATAW<'a> {
|
||||
#[doc = r" Writes raw bits to the field"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(self, value: u32) -> &'a mut W {
|
||||
const MASK: u32 = 4294967295;
|
||||
const OFFSET: u8 = 0;
|
||||
self.w.bits &= !((MASK as u32) << OFFSET);
|
||||
self.w.bits |= ((value & MASK) as u32) << OFFSET;
|
||||
self.w
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = r" Reset value of the register"]
|
||||
#[inline]
|
||||
pub fn reset_value() -> W {
|
||||
W { bits: 0 }
|
||||
}
|
||||
#[doc = r" Writes raw bits to the register"]
|
||||
#[inline]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.bits = bits;
|
||||
self
|
||||
}
|
||||
#[doc = "Bits 0:31 - Transmit Data"]
|
||||
#[inline]
|
||||
pub fn data(&mut self) -> _DATAW {
|
||||
_DATAW { w: self }
|
||||
}
|
||||
}
|
||||
#[doc = "Writer for register TDR"]
|
||||
pub type W = crate::W<u32, super::TDR>;
|
||||
#[doc = "Register TDR `reset()`'s with value 0"]
|
||||
impl crate::ResetValue for super::TDR {
|
||||
type Type = u32;
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Type {
|
||||
0
|
||||
}
|
||||
}
|
||||
#[doc = "Write proxy for field `DATA`"]
|
||||
pub struct DATA_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> DATA_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 W {
|
||||
#[doc = "Bits 0:31 - Transmit Data"]
|
||||
#[inline(always)]
|
||||
pub fn data(&mut self) -> DATA_W {
|
||||
DATA_W { w: self }
|
||||
}
|
||||
}
|
||||
|
@ -1,101 +1,54 @@
|
||||
#[doc = r" Value read from the register"]
|
||||
pub struct R {
|
||||
bits: u32,
|
||||
}
|
||||
impl super::VERID {
|
||||
#[doc = r" Reads the contents of the register"]
|
||||
#[inline]
|
||||
pub fn read(&self) -> R {
|
||||
R { bits: self.register.get() }
|
||||
}
|
||||
}
|
||||
#[doc = "Possible values of the field `FEATURE`"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum FEATURER {
|
||||
#[doc = "Standard feature set supporting 32-bit shift register."]
|
||||
_0000000000000100,
|
||||
#[doc = r" Reserved"]
|
||||
_Reserved(u16),
|
||||
}
|
||||
impl FEATURER {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u16 {
|
||||
match *self {
|
||||
FEATURER::_0000000000000100 => 4,
|
||||
FEATURER::_Reserved(bits) => bits,
|
||||
}
|
||||
}
|
||||
#[allow(missing_docs)]
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
pub fn _from(value: u16) -> FEATURER {
|
||||
match value {
|
||||
4 => FEATURER::_0000000000000100,
|
||||
i => FEATURER::_Reserved(i),
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0000000000000100`"]
|
||||
#[inline]
|
||||
pub fn is_0000000000000100(&self) -> bool {
|
||||
*self == FEATURER::_0000000000000100
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct MINORR {
|
||||
bits: u8,
|
||||
}
|
||||
impl MINORR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Value of the field"]
|
||||
pub struct MAJORR {
|
||||
bits: u8,
|
||||
}
|
||||
impl MAJORR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = r" Value of the register as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.bits
|
||||
}
|
||||
#[doc = "Bits 0:15 - Module Identification Number"]
|
||||
#[inline]
|
||||
pub fn feature(&self) -> FEATURER {
|
||||
FEATURER::_from({
|
||||
const MASK: u16 = 65535;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u16
|
||||
})
|
||||
}
|
||||
#[doc = "Bits 16:23 - Minor Version Number"]
|
||||
#[inline]
|
||||
pub fn minor(&self) -> MINORR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 16;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
MINORR { bits }
|
||||
}
|
||||
#[doc = "Bits 24:31 - Major Version Number"]
|
||||
#[inline]
|
||||
pub fn major(&self) -> MAJORR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 24;
|
||||
((self.bits >> OFFSET) & MASK as u32) as u8
|
||||
};
|
||||
MAJORR { bits }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register VERID"]
|
||||
pub type R = crate::R<u32, super::VERID>;
|
||||
#[doc = "Module Identification Number\n\nValue on reset: 4"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[repr(u16)]
|
||||
pub enum FEATURE_A {
|
||||
#[doc = "4: Standard feature set supporting 32-bit shift register."]
|
||||
_0000000000000100 = 4,
|
||||
}
|
||||
impl From<FEATURE_A> for u16 {
|
||||
#[inline(always)]
|
||||
fn from(variant: FEATURE_A) -> Self {
|
||||
variant as _
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `FEATURE`"]
|
||||
pub type FEATURE_R = crate::R<u16, FEATURE_A>;
|
||||
impl FEATURE_R {
|
||||
#[doc = r"Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> crate::Variant<u16, FEATURE_A> {
|
||||
use crate::Variant::*;
|
||||
match self.bits {
|
||||
4 => Val(FEATURE_A::_0000000000000100),
|
||||
i => Res(i),
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `_0000000000000100`"]
|
||||
#[inline(always)]
|
||||
pub fn is_0000000000000100(&self) -> bool {
|
||||
*self == FEATURE_A::_0000000000000100
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `MINOR`"]
|
||||
pub type MINOR_R = crate::R<u8, u8>;
|
||||
#[doc = "Reader of field `MAJOR`"]
|
||||
pub type MAJOR_R = crate::R<u8, u8>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:15 - Module Identification Number"]
|
||||
#[inline(always)]
|
||||
pub fn feature(&self) -> FEATURE_R {
|
||||
FEATURE_R::new((self.bits & 0xffff) as u16)
|
||||
}
|
||||
#[doc = "Bits 16:23 - Minor Version Number"]
|
||||
#[inline(always)]
|
||||
pub fn minor(&self) -> MINOR_R {
|
||||
MINOR_R::new(((self.bits >> 16) & 0xff) as u8)
|
||||
}
|
||||
#[doc = "Bits 24:31 - Major Version Number"]
|
||||
#[inline(always)]
|
||||
pub fn major(&self) -> MAJOR_R {
|
||||
MAJOR_R::new(((self.bits >> 24) & 0xff) as u8)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user