s32k118: rewrite everything for s32k118
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
@ -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::DATAHL {
|
||||
#[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 DATAHLR {
|
||||
bits: u8,
|
||||
}
|
||||
impl DATAHLR {
|
||||
#[doc = r" Value of the field as raw bits"]
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u8 {
|
||||
self.bits
|
||||
}
|
||||
}
|
||||
#[doc = r" Proxy"]
|
||||
pub struct _DATAHLW<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> _DATAHLW<'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 - DATAHL stores the third 8 bits of the 32 bit CRC"]
|
||||
#[inline]
|
||||
pub fn datahl(&self) -> DATAHLR {
|
||||
let bits = {
|
||||
const MASK: u8 = 255;
|
||||
const OFFSET: u8 = 0;
|
||||
((self.bits >> OFFSET) & MASK as u8) as u8
|
||||
};
|
||||
DATAHLR { 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 - DATAHL stores the third 8 bits of the 32 bit CRC"]
|
||||
#[inline]
|
||||
pub fn datahl(&mut self) -> _DATAHLW {
|
||||
_DATAHLW { w: self }
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of register DATAHL"]
|
||||
pub type R = crate::R<u8, super::DATAHL>;
|
||||
#[doc = "Writer for register DATAHL"]
|
||||
pub type W = crate::W<u8, super::DATAHL>;
|
||||
#[doc = "Register DATAHL `reset()`'s with value 0xff"]
|
||||
impl crate::ResetValue for super::DATAHL {
|
||||
type Type = u8;
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Type {
|
||||
0xff
|
||||
}
|
||||
}
|
||||
#[doc = "Reader of field `DATAHL`"]
|
||||
pub type DATAHL_R = crate::R<u8, u8>;
|
||||
#[doc = "Write proxy for field `DATAHL`"]
|
||||
pub struct DATAHL_W<'a> {
|
||||
w: &'a mut W,
|
||||
}
|
||||
impl<'a> DATAHL_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 - DATAHL stores the third 8 bits of the 32 bit CRC"]
|
||||
#[inline(always)]
|
||||
pub fn datahl(&self) -> DATAHL_R {
|
||||
DATAHL_R::new((self.bits & 0xff) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:7 - DATAHL stores the third 8 bits of the 32 bit CRC"]
|
||||
#[inline(always)]
|
||||
pub fn datahl(&mut self) -> DATAHL_W {
|
||||
DATAHL_W { w: self }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user