#[doc = "Register `FPDSCR` reader"]
pub struct R(crate::R<FPDSCR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FPDSCR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FPDSCR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<FPDSCR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `FPDSCR` writer"]
pub struct W(crate::W<FPDSCR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<FPDSCR_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<FPDSCR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<FPDSCR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `RMode` reader - Default value for FPSCR.RMode"]
pub struct RMODE_R(crate::FieldReader<u8, u8>);
impl RMODE_R {
pub(crate) fn new(bits: u8) -> Self {
RMODE_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RMODE_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RMode` writer - Default value for FPSCR.RMode"]
pub struct RMODE_W<'a> {
w: &'a mut W,
}
impl<'a> RMODE_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 << 22)) | ((value as u32 & 0x03) << 22);
self.w
}
}
#[doc = "Field `FZ` reader - Default value for FPSCR.FZ"]
pub struct FZ_R(crate::FieldReader<bool, bool>);
impl FZ_R {
pub(crate) fn new(bits: bool) -> Self {
FZ_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FZ_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FZ` writer - Default value for FPSCR.FZ"]
pub struct FZ_W<'a> {
w: &'a mut W,
}
impl<'a> FZ_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 << 24)) | ((value as u32 & 0x01) << 24);
self.w
}
}
#[doc = "Field `DN` reader - Default value for FPSCR.DN"]
pub struct DN_R(crate::FieldReader<bool, bool>);
impl DN_R {
pub(crate) fn new(bits: bool) -> Self {
DN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for DN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `DN` writer - Default value for FPSCR.DN"]
pub struct DN_W<'a> {
w: &'a mut W,
}
impl<'a> DN_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 << 25)) | ((value as u32 & 0x01) << 25);
self.w
}
}
#[doc = "Field `AHP` reader - Default value for FPSCR.AHP"]
pub struct AHP_R(crate::FieldReader<bool, bool>);
impl AHP_R {
pub(crate) fn new(bits: bool) -> Self {
AHP_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for AHP_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `AHP` writer - Default value for FPSCR.AHP"]
pub struct AHP_W<'a> {
w: &'a mut W,
}
impl<'a> AHP_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 << 26)) | ((value as u32 & 0x01) << 26);
self.w
}
}
impl R {
#[doc = "Bits 22:23 - Default value for FPSCR.RMode"]
#[inline(always)]
pub fn rmode(&self) -> RMODE_R {
RMODE_R::new(((self.bits >> 22) & 0x03) as u8)
}
#[doc = "Bit 24 - Default value for FPSCR.FZ"]
#[inline(always)]
pub fn fz(&self) -> FZ_R {
FZ_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bit 25 - Default value for FPSCR.DN"]
#[inline(always)]
pub fn dn(&self) -> DN_R {
DN_R::new(((self.bits >> 25) & 0x01) != 0)
}
#[doc = "Bit 26 - Default value for FPSCR.AHP"]
#[inline(always)]
pub fn ahp(&self) -> AHP_R {
AHP_R::new(((self.bits >> 26) & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 22:23 - Default value for FPSCR.RMode"]
#[inline(always)]
pub fn rmode(&mut self) -> RMODE_W {
RMODE_W { w: self }
}
#[doc = "Bit 24 - Default value for FPSCR.FZ"]
#[inline(always)]
pub fn fz(&mut self) -> FZ_W {
FZ_W { w: self }
}
#[doc = "Bit 25 - Default value for FPSCR.DN"]
#[inline(always)]
pub fn dn(&mut self) -> DN_W {
DN_W { w: self }
}
#[doc = "Bit 26 - Default value for FPSCR.AHP"]
#[inline(always)]
pub fn ahp(&mut self) -> AHP_W {
AHP_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 = "Floating-point Default Status Control 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 [fpdscr](index.html) module"]
pub struct FPDSCR_SPEC;
impl crate::RegisterSpec for FPDSCR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [fpdscr::R](R) reader structure"]
impl crate::Readable for FPDSCR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [fpdscr::W](W) writer structure"]
impl crate::Writable for FPDSCR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets FPDSCR to value 0"]
impl crate::Resettable for FPDSCR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}