#[doc = "Register `PLLSAI1CFGR` reader"]
pub struct R(crate::R<PLLSAI1CFGR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PLLSAI1CFGR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PLLSAI1CFGR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PLLSAI1CFGR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PLLSAI1CFGR` writer"]
pub struct W(crate::W<PLLSAI1CFGR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PLLSAI1CFGR_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<PLLSAI1CFGR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PLLSAI1CFGR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `PLLSAI1R` reader - PLLSAI1 division factor for PLLADC1CLK (ADC clock)"]
pub struct PLLSAI1R_R(crate::FieldReader<u8, u8>);
impl PLLSAI1R_R {
pub(crate) fn new(bits: u8) -> Self {
PLLSAI1R_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLLSAI1R_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLLSAI1R` writer - PLLSAI1 division factor for PLLADC1CLK (ADC clock)"]
pub struct PLLSAI1R_W<'a> {
w: &'a mut W,
}
impl<'a> PLLSAI1R_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 << 25)) | ((value as u32 & 0x03) << 25);
self.w
}
}
#[doc = "Field `PLLSAI1REN` reader - PLLSAI1 PLLADC1CLK output enable"]
pub struct PLLSAI1REN_R(crate::FieldReader<bool, bool>);
impl PLLSAI1REN_R {
pub(crate) fn new(bits: bool) -> Self {
PLLSAI1REN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLLSAI1REN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLLSAI1REN` writer - PLLSAI1 PLLADC1CLK output enable"]
pub struct PLLSAI1REN_W<'a> {
w: &'a mut W,
}
impl<'a> PLLSAI1REN_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 `PLLSAI1Q` reader - SAI1PLL division factor for PLLUSB2CLK (48 MHz clock)"]
pub struct PLLSAI1Q_R(crate::FieldReader<u8, u8>);
impl PLLSAI1Q_R {
pub(crate) fn new(bits: u8) -> Self {
PLLSAI1Q_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLLSAI1Q_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLLSAI1Q` writer - SAI1PLL division factor for PLLUSB2CLK (48 MHz clock)"]
pub struct PLLSAI1Q_W<'a> {
w: &'a mut W,
}
impl<'a> PLLSAI1Q_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 << 21)) | ((value as u32 & 0x03) << 21);
self.w
}
}
#[doc = "Field `PLLSAI1QEN` reader - SAI1PLL PLLUSB2CLK output enable"]
pub struct PLLSAI1QEN_R(crate::FieldReader<bool, bool>);
impl PLLSAI1QEN_R {
pub(crate) fn new(bits: bool) -> Self {
PLLSAI1QEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLLSAI1QEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLLSAI1QEN` writer - SAI1PLL PLLUSB2CLK output enable"]
pub struct PLLSAI1QEN_W<'a> {
w: &'a mut W,
}
impl<'a> PLLSAI1QEN_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 << 20)) | ((value as u32 & 0x01) << 20);
self.w
}
}
#[doc = "Field `PLLSAI1P` reader - SAI1PLL division factor for PLLSAI1CLK (SAI1 or SAI2 clock)"]
pub struct PLLSAI1P_R(crate::FieldReader<bool, bool>);
impl PLLSAI1P_R {
pub(crate) fn new(bits: bool) -> Self {
PLLSAI1P_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLLSAI1P_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLLSAI1P` writer - SAI1PLL division factor for PLLSAI1CLK (SAI1 or SAI2 clock)"]
pub struct PLLSAI1P_W<'a> {
w: &'a mut W,
}
impl<'a> PLLSAI1P_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 << 17)) | ((value as u32 & 0x01) << 17);
self.w
}
}
#[doc = "Field `PLLSAI1PEN` reader - SAI1PLL PLLSAI1CLK output enable"]
pub struct PLLSAI1PEN_R(crate::FieldReader<bool, bool>);
impl PLLSAI1PEN_R {
pub(crate) fn new(bits: bool) -> Self {
PLLSAI1PEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLLSAI1PEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLLSAI1PEN` writer - SAI1PLL PLLSAI1CLK output enable"]
pub struct PLLSAI1PEN_W<'a> {
w: &'a mut W,
}
impl<'a> PLLSAI1PEN_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 << 16)) | ((value as u32 & 0x01) << 16);
self.w
}
}
#[doc = "Field `PLLSAI1N` reader - SAI1PLL multiplication factor for VCO"]
pub struct PLLSAI1N_R(crate::FieldReader<u8, u8>);
impl PLLSAI1N_R {
pub(crate) fn new(bits: u8) -> Self {
PLLSAI1N_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PLLSAI1N_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `PLLSAI1N` writer - SAI1PLL multiplication factor for VCO"]
pub struct PLLSAI1N_W<'a> {
w: &'a mut W,
}
impl<'a> PLLSAI1N_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 & !(0x7f << 8)) | ((value as u32 & 0x7f) << 8);
self.w
}
}
impl R {
#[doc = "Bits 25:26 - PLLSAI1 division factor for PLLADC1CLK (ADC clock)"]
#[inline(always)]
pub fn pllsai1r(&self) -> PLLSAI1R_R {
PLLSAI1R_R::new(((self.bits >> 25) & 0x03) as u8)
}
#[doc = "Bit 24 - PLLSAI1 PLLADC1CLK output enable"]
#[inline(always)]
pub fn pllsai1ren(&self) -> PLLSAI1REN_R {
PLLSAI1REN_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bits 21:22 - SAI1PLL division factor for PLLUSB2CLK (48 MHz clock)"]
#[inline(always)]
pub fn pllsai1q(&self) -> PLLSAI1Q_R {
PLLSAI1Q_R::new(((self.bits >> 21) & 0x03) as u8)
}
#[doc = "Bit 20 - SAI1PLL PLLUSB2CLK output enable"]
#[inline(always)]
pub fn pllsai1qen(&self) -> PLLSAI1QEN_R {
PLLSAI1QEN_R::new(((self.bits >> 20) & 0x01) != 0)
}
#[doc = "Bit 17 - SAI1PLL division factor for PLLSAI1CLK (SAI1 or SAI2 clock)"]
#[inline(always)]
pub fn pllsai1p(&self) -> PLLSAI1P_R {
PLLSAI1P_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 16 - SAI1PLL PLLSAI1CLK output enable"]
#[inline(always)]
pub fn pllsai1pen(&self) -> PLLSAI1PEN_R {
PLLSAI1PEN_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bits 8:14 - SAI1PLL multiplication factor for VCO"]
#[inline(always)]
pub fn pllsai1n(&self) -> PLLSAI1N_R {
PLLSAI1N_R::new(((self.bits >> 8) & 0x7f) as u8)
}
}
impl W {
#[doc = "Bits 25:26 - PLLSAI1 division factor for PLLADC1CLK (ADC clock)"]
#[inline(always)]
pub fn pllsai1r(&mut self) -> PLLSAI1R_W {
PLLSAI1R_W { w: self }
}
#[doc = "Bit 24 - PLLSAI1 PLLADC1CLK output enable"]
#[inline(always)]
pub fn pllsai1ren(&mut self) -> PLLSAI1REN_W {
PLLSAI1REN_W { w: self }
}
#[doc = "Bits 21:22 - SAI1PLL division factor for PLLUSB2CLK (48 MHz clock)"]
#[inline(always)]
pub fn pllsai1q(&mut self) -> PLLSAI1Q_W {
PLLSAI1Q_W { w: self }
}
#[doc = "Bit 20 - SAI1PLL PLLUSB2CLK output enable"]
#[inline(always)]
pub fn pllsai1qen(&mut self) -> PLLSAI1QEN_W {
PLLSAI1QEN_W { w: self }
}
#[doc = "Bit 17 - SAI1PLL division factor for PLLSAI1CLK (SAI1 or SAI2 clock)"]
#[inline(always)]
pub fn pllsai1p(&mut self) -> PLLSAI1P_W {
PLLSAI1P_W { w: self }
}
#[doc = "Bit 16 - SAI1PLL PLLSAI1CLK output enable"]
#[inline(always)]
pub fn pllsai1pen(&mut self) -> PLLSAI1PEN_W {
PLLSAI1PEN_W { w: self }
}
#[doc = "Bits 8:14 - SAI1PLL multiplication factor for VCO"]
#[inline(always)]
pub fn pllsai1n(&mut self) -> PLLSAI1N_W {
PLLSAI1N_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 = "PLLSAI1 configuration 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 [pllsai1cfgr](index.html) module"]
pub struct PLLSAI1CFGR_SPEC;
impl crate::RegisterSpec for PLLSAI1CFGR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [pllsai1cfgr::R](R) reader structure"]
impl crate::Readable for PLLSAI1CFGR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pllsai1cfgr::W](W) writer structure"]
impl crate::Writable for PLLSAI1CFGR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PLLSAI1CFGR to value 0x1000"]
impl crate::Resettable for PLLSAI1CFGR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x1000
}
}