s32k118: rewrite everything for s32k118

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
2020-12-07 18:24:29 +08:00
parent 444b0e87d1
commit 96cd7368a2
1840 changed files with 339977 additions and 617779 deletions

View File

@ -1,103 +1,40 @@
#[doc = r" Value read from the register"]
pub struct R {
bits: u8,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u8,
}
impl super::DATALU {
#[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 DATALUR {
bits: u8,
}
impl DATALUR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Proxy"]
pub struct _DATALUW<'a> {
w: &'a mut W,
}
impl<'a> _DATALUW<'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 u8) << OFFSET);
self.w.bits |= ((value & MASK) as u8) << OFFSET;
self.w
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
#[doc = "Bits 0:7 - DATALL stores the second 8 bits of the 32 bit CRC"]
#[inline]
pub fn datalu(&self) -> DATALUR {
let bits = {
const MASK: u8 = 255;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u8) as u8
};
DATALUR { bits }
}
}
impl W {
#[doc = r" Reset value of the register"]
#[inline]
pub fn reset_value() -> W {
W { bits: 255 }
}
#[doc = r" Writes raw bits to the register"]
#[inline]
pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bits 0:7 - DATALL stores the second 8 bits of the 32 bit CRC"]
#[inline]
pub fn datalu(&mut self) -> _DATALUW {
_DATALUW { w: self }
}
}
#[doc = "Reader of register DATALU"]
pub type R = crate::R<u8, super::DATALU>;
#[doc = "Writer for register DATALU"]
pub type W = crate::W<u8, super::DATALU>;
#[doc = "Register DATALU `reset()`'s with value 0xff"]
impl crate::ResetValue for super::DATALU {
type Type = u8;
#[inline(always)]
fn reset_value() -> Self::Type {
0xff
}
}
#[doc = "Reader of field `DATALU`"]
pub type DATALU_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `DATALU`"]
pub struct DATALU_W<'a> {
w: &'a mut W,
}
impl<'a> DATALU_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 u8) & 0xff);
self.w
}
}
impl R {
#[doc = "Bits 0:7 - DATALL stores the second 8 bits of the 32 bit CRC"]
#[inline(always)]
pub fn datalu(&self) -> DATALU_R {
DATALU_R::new((self.bits & 0xff) as u8)
}
}
impl W {
#[doc = "Bits 0:7 - DATALL stores the second 8 bits of the 32 bit CRC"]
#[inline(always)]
pub fn datalu(&mut self) -> DATALU_W {
DATALU_W { w: self }
}
}