#[doc = "Reader of register CFGR1"]
pub type R = crate::R<u32, super::CFGR1>;
#[doc = "Writer for register CFGR1"]
pub type W = crate::W<u32, super::CFGR1>;
#[doc = "Register CFGR1 `reset()`'s with value 0x7c00_0001"]
impl crate::ResetValue for super::CFGR1 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0x7c00_0001
}
}
#[doc = "Reader of field `FPU_IE`"]
pub type FPU_IE_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `FPU_IE`"]
pub struct FPU_IE_W<'a> {
w: &'a mut W,
}
impl<'a> FPU_IE_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 & !(0x3f << 26)) | (((value as u32) & 0x3f) << 26);
self.w
}
}
#[doc = "Reader of field `I2C3_FMP`"]
pub type I2C3_FMP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2C3_FMP`"]
pub struct I2C3_FMP_W<'a> {
w: &'a mut W,
}
impl<'a> I2C3_FMP_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 << 22)) | (((value as u32) & 0x01) << 22);
self.w
}
}
#[doc = "Reader of field `I2C2_FMP`"]
pub type I2C2_FMP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2C2_FMP`"]
pub struct I2C2_FMP_W<'a> {
w: &'a mut W,
}
impl<'a> I2C2_FMP_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 << 21)) | (((value as u32) & 0x01) << 21);
self.w
}
}
#[doc = "Reader of field `I2C1_FMP`"]
pub type I2C1_FMP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2C1_FMP`"]
pub struct I2C1_FMP_W<'a> {
w: &'a mut W,
}
impl<'a> I2C1_FMP_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 = "Reader of field `I2C_PB9_FMP`"]
pub type I2C_PB9_FMP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2C_PB9_FMP`"]
pub struct I2C_PB9_FMP_W<'a> {
w: &'a mut W,
}
impl<'a> I2C_PB9_FMP_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 << 19)) | (((value as u32) & 0x01) << 19);
self.w
}
}
#[doc = "Reader of field `I2C_PB8_FMP`"]
pub type I2C_PB8_FMP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2C_PB8_FMP`"]
pub struct I2C_PB8_FMP_W<'a> {
w: &'a mut W,
}
impl<'a> I2C_PB8_FMP_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 << 18)) | (((value as u32) & 0x01) << 18);
self.w
}
}
#[doc = "Reader of field `I2C_PB7_FMP`"]
pub type I2C_PB7_FMP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2C_PB7_FMP`"]
pub struct I2C_PB7_FMP_W<'a> {
w: &'a mut W,
}
impl<'a> I2C_PB7_FMP_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 = "Reader of field `I2C_PB6_FMP`"]
pub type I2C_PB6_FMP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2C_PB6_FMP`"]
pub struct I2C_PB6_FMP_W<'a> {
w: &'a mut W,
}
impl<'a> I2C_PB6_FMP_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 = "Reader of field `BOOSTEN`"]
pub type BOOSTEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `BOOSTEN`"]
pub struct BOOSTEN_W<'a> {
w: &'a mut W,
}
impl<'a> BOOSTEN_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 << 8)) | (((value as u32) & 0x01) << 8);
self.w
}
}
#[doc = "Reader of field `FWDIS`"]
pub type FWDIS_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FWDIS`"]
pub struct FWDIS_W<'a> {
w: &'a mut W,
}
impl<'a> FWDIS_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) | ((value as u32) & 0x01);
self.w
}
}
impl R {
#[doc = "Bits 26:31 - Floating Point Unit interrupts enable bits"]
#[inline(always)]
pub fn fpu_ie(&self) -> FPU_IE_R {
FPU_IE_R::new(((self.bits >> 26) & 0x3f) as u8)
}
#[doc = "Bit 22 - I2C3 Fast-mode Plus driving capability activation"]
#[inline(always)]
pub fn i2c3_fmp(&self) -> I2C3_FMP_R {
I2C3_FMP_R::new(((self.bits >> 22) & 0x01) != 0)
}
#[doc = "Bit 21 - I2C2 Fast-mode Plus driving capability activation"]
#[inline(always)]
pub fn i2c2_fmp(&self) -> I2C2_FMP_R {
I2C2_FMP_R::new(((self.bits >> 21) & 0x01) != 0)
}
#[doc = "Bit 20 - I2C1 Fast-mode Plus driving capability activation"]
#[inline(always)]
pub fn i2c1_fmp(&self) -> I2C1_FMP_R {
I2C1_FMP_R::new(((self.bits >> 20) & 0x01) != 0)
}
#[doc = "Bit 19 - Fast-mode Plus (Fm+) driving capability activation on PB9"]
#[inline(always)]
pub fn i2c_pb9_fmp(&self) -> I2C_PB9_FMP_R {
I2C_PB9_FMP_R::new(((self.bits >> 19) & 0x01) != 0)
}
#[doc = "Bit 18 - Fast-mode Plus (Fm+) driving capability activation on PB8"]
#[inline(always)]
pub fn i2c_pb8_fmp(&self) -> I2C_PB8_FMP_R {
I2C_PB8_FMP_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 17 - Fast-mode Plus (Fm+) driving capability activation on PB7"]
#[inline(always)]
pub fn i2c_pb7_fmp(&self) -> I2C_PB7_FMP_R {
I2C_PB7_FMP_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 16 - Fast-mode Plus (Fm+) driving capability activation on PB6"]
#[inline(always)]
pub fn i2c_pb6_fmp(&self) -> I2C_PB6_FMP_R {
I2C_PB6_FMP_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 8 - I/O analog switch voltage booster enable"]
#[inline(always)]
pub fn boosten(&self) -> BOOSTEN_R {
BOOSTEN_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 0 - Firewall disable"]
#[inline(always)]
pub fn fwdis(&self) -> FWDIS_R {
FWDIS_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 26:31 - Floating Point Unit interrupts enable bits"]
#[inline(always)]
pub fn fpu_ie(&mut self) -> FPU_IE_W {
FPU_IE_W { w: self }
}
#[doc = "Bit 22 - I2C3 Fast-mode Plus driving capability activation"]
#[inline(always)]
pub fn i2c3_fmp(&mut self) -> I2C3_FMP_W {
I2C3_FMP_W { w: self }
}
#[doc = "Bit 21 - I2C2 Fast-mode Plus driving capability activation"]
#[inline(always)]
pub fn i2c2_fmp(&mut self) -> I2C2_FMP_W {
I2C2_FMP_W { w: self }
}
#[doc = "Bit 20 - I2C1 Fast-mode Plus driving capability activation"]
#[inline(always)]
pub fn i2c1_fmp(&mut self) -> I2C1_FMP_W {
I2C1_FMP_W { w: self }
}
#[doc = "Bit 19 - Fast-mode Plus (Fm+) driving capability activation on PB9"]
#[inline(always)]
pub fn i2c_pb9_fmp(&mut self) -> I2C_PB9_FMP_W {
I2C_PB9_FMP_W { w: self }
}
#[doc = "Bit 18 - Fast-mode Plus (Fm+) driving capability activation on PB8"]
#[inline(always)]
pub fn i2c_pb8_fmp(&mut self) -> I2C_PB8_FMP_W {
I2C_PB8_FMP_W { w: self }
}
#[doc = "Bit 17 - Fast-mode Plus (Fm+) driving capability activation on PB7"]
#[inline(always)]
pub fn i2c_pb7_fmp(&mut self) -> I2C_PB7_FMP_W {
I2C_PB7_FMP_W { w: self }
}
#[doc = "Bit 16 - Fast-mode Plus (Fm+) driving capability activation on PB6"]
#[inline(always)]
pub fn i2c_pb6_fmp(&mut self) -> I2C_PB6_FMP_W {
I2C_PB6_FMP_W { w: self }
}
#[doc = "Bit 8 - I/O analog switch voltage booster enable"]
#[inline(always)]
pub fn boosten(&mut self) -> BOOSTEN_W {
BOOSTEN_W { w: self }
}
#[doc = "Bit 0 - Firewall disable"]
#[inline(always)]
pub fn fwdis(&mut self) -> FWDIS_W {
FWDIS_W { w: self }
}
}