#[doc = "Register `DFSDM2_FCR` reader"]
pub struct R(crate::R<DFSDM2_FCR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<DFSDM2_FCR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<DFSDM2_FCR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<DFSDM2_FCR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `DFSDM2_FCR` writer"]
pub struct W(crate::W<DFSDM2_FCR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<DFSDM2_FCR_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<DFSDM2_FCR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<DFSDM2_FCR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `FORD` reader - Sinc filter order"]
pub struct FORD_R(crate::FieldReader<u8, u8>);
impl FORD_R {
pub(crate) fn new(bits: u8) -> Self {
FORD_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FORD_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FORD` writer - Sinc filter order"]
pub struct FORD_W<'a> {
w: &'a mut W,
}
impl<'a> FORD_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 << 29)) | ((value as u32 & 0x07) << 29);
self.w
}
}
#[doc = "Field `FOSR` reader - Sinc filter oversampling ratio (decimation rate)"]
pub struct FOSR_R(crate::FieldReader<u16, u16>);
impl FOSR_R {
pub(crate) fn new(bits: u16) -> Self {
FOSR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FOSR_R {
type Target = crate::FieldReader<u16, u16>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FOSR` writer - Sinc filter oversampling ratio (decimation rate)"]
pub struct FOSR_W<'a> {
w: &'a mut W,
}
impl<'a> FOSR_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 & !(0x03ff << 16)) | ((value as u32 & 0x03ff) << 16);
self.w
}
}
#[doc = "Field `IOSR` reader - Integrator oversampling ratio (averaging length)"]
pub struct IOSR_R(crate::FieldReader<u8, u8>);
impl IOSR_R {
pub(crate) fn new(bits: u8) -> Self {
IOSR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for IOSR_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `IOSR` writer - Integrator oversampling ratio (averaging length)"]
pub struct IOSR_W<'a> {
w: &'a mut W,
}
impl<'a> IOSR_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
}
}
impl R {
#[doc = "Bits 29:31 - Sinc filter order"]
#[inline(always)]
pub fn ford(&self) -> FORD_R {
FORD_R::new(((self.bits >> 29) & 0x07) as u8)
}
#[doc = "Bits 16:25 - Sinc filter oversampling ratio (decimation rate)"]
#[inline(always)]
pub fn fosr(&self) -> FOSR_R {
FOSR_R::new(((self.bits >> 16) & 0x03ff) as u16)
}
#[doc = "Bits 0:7 - Integrator oversampling ratio (averaging length)"]
#[inline(always)]
pub fn iosr(&self) -> IOSR_R {
IOSR_R::new((self.bits & 0xff) as u8)
}
}
impl W {
#[doc = "Bits 29:31 - Sinc filter order"]
#[inline(always)]
pub fn ford(&mut self) -> FORD_W {
FORD_W { w: self }
}
#[doc = "Bits 16:25 - Sinc filter oversampling ratio (decimation rate)"]
#[inline(always)]
pub fn fosr(&mut self) -> FOSR_W {
FOSR_W { w: self }
}
#[doc = "Bits 0:7 - Integrator oversampling ratio (averaging length)"]
#[inline(always)]
pub fn iosr(&mut self) -> IOSR_W {
IOSR_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 = "filter 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 [dfsdm2_fcr](index.html) module"]
pub struct DFSDM2_FCR_SPEC;
impl crate::RegisterSpec for DFSDM2_FCR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [dfsdm2_fcr::R](R) reader structure"]
impl crate::Readable for DFSDM2_FCR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [dfsdm2_fcr::W](W) writer structure"]
impl crate::Writable for DFSDM2_FCR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets DFSDM2_FCR to value 0"]
impl crate::Resettable for DFSDM2_FCR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}