#[doc = "Register `I2C_ICR` writer"]
pub struct W(crate::W<I2C_ICR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<I2C_ICR_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<I2C_ICR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<I2C_ICR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `ADDRCF` writer - ADDRCF"]
pub struct ADDRCF_W<'a> {
w: &'a mut W,
}
impl<'a> ADDRCF_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 << 3)) | ((value as u32 & 0x01) << 3);
self.w
}
}
#[doc = "Field `NACKCF` writer - NACKCF"]
pub struct NACKCF_W<'a> {
w: &'a mut W,
}
impl<'a> NACKCF_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 << 4)) | ((value as u32 & 0x01) << 4);
self.w
}
}
#[doc = "Field `STOPCF` writer - STOPCF"]
pub struct STOPCF_W<'a> {
w: &'a mut W,
}
impl<'a> STOPCF_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 << 5)) | ((value as u32 & 0x01) << 5);
self.w
}
}
#[doc = "Field `BERRCF` writer - BERRCF"]
pub struct BERRCF_W<'a> {
w: &'a mut W,
}
impl<'a> BERRCF_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 = "Field `ARLOCF` writer - ARLOCF"]
pub struct ARLOCF_W<'a> {
w: &'a mut W,
}
impl<'a> ARLOCF_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 << 9)) | ((value as u32 & 0x01) << 9);
self.w
}
}
#[doc = "Field `OVRCF` writer - OVRCF"]
pub struct OVRCF_W<'a> {
w: &'a mut W,
}
impl<'a> OVRCF_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 << 10)) | ((value as u32 & 0x01) << 10);
self.w
}
}
#[doc = "Field `PECCF` writer - PECCF"]
pub struct PECCF_W<'a> {
w: &'a mut W,
}
impl<'a> PECCF_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 << 11)) | ((value as u32 & 0x01) << 11);
self.w
}
}
#[doc = "Field `TIMOUTCF` writer - TIMOUTCF"]
pub struct TIMOUTCF_W<'a> {
w: &'a mut W,
}
impl<'a> TIMOUTCF_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 << 12)) | ((value as u32 & 0x01) << 12);
self.w
}
}
#[doc = "Field `ALERTCF` writer - ALERTCF"]
pub struct ALERTCF_W<'a> {
w: &'a mut W,
}
impl<'a> ALERTCF_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 << 13)) | ((value as u32 & 0x01) << 13);
self.w
}
}
impl W {
#[doc = "Bit 3 - ADDRCF"]
#[inline(always)]
pub fn addrcf(&mut self) -> ADDRCF_W {
ADDRCF_W { w: self }
}
#[doc = "Bit 4 - NACKCF"]
#[inline(always)]
pub fn nackcf(&mut self) -> NACKCF_W {
NACKCF_W { w: self }
}
#[doc = "Bit 5 - STOPCF"]
#[inline(always)]
pub fn stopcf(&mut self) -> STOPCF_W {
STOPCF_W { w: self }
}
#[doc = "Bit 8 - BERRCF"]
#[inline(always)]
pub fn berrcf(&mut self) -> BERRCF_W {
BERRCF_W { w: self }
}
#[doc = "Bit 9 - ARLOCF"]
#[inline(always)]
pub fn arlocf(&mut self) -> ARLOCF_W {
ARLOCF_W { w: self }
}
#[doc = "Bit 10 - OVRCF"]
#[inline(always)]
pub fn ovrcf(&mut self) -> OVRCF_W {
OVRCF_W { w: self }
}
#[doc = "Bit 11 - PECCF"]
#[inline(always)]
pub fn peccf(&mut self) -> PECCF_W {
PECCF_W { w: self }
}
#[doc = "Bit 12 - TIMOUTCF"]
#[inline(always)]
pub fn timoutcf(&mut self) -> TIMOUTCF_W {
TIMOUTCF_W { w: self }
}
#[doc = "Bit 13 - ALERTCF"]
#[inline(always)]
pub fn alertcf(&mut self) -> ALERTCF_W {
ALERTCF_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 = "Access: No wait states\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [i2c_icr](index.html) module"]
pub struct I2C_ICR_SPEC;
impl crate::RegisterSpec for I2C_ICR_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [i2c_icr::W](W) writer structure"]
impl crate::Writable for I2C_ICR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets I2C_ICR to value 0"]
impl crate::Resettable for I2C_ICR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}