#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::ICR {
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = "Values that can be written to the field `ALERTCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALERTCFW {
#[doc = "Clears the ALERT flag in ISR register"]
CLEAR,
}
impl ALERTCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ALERTCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ALERTCFW<'a> {
w: &'a mut W,
}
impl<'a> _ALERTCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ALERTCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the ALERT flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(ALERTCFW::CLEAR)
}
#[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 &= !(0x01 << 13);
self.w.bits |= ((value as u32) & 0x01) << 13;
self.w
}
}
#[doc = "Values that can be written to the field `TIMOUTCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TIMOUTCFW {
#[doc = "Clears the TIMOUT flag in ISR register"]
CLEAR,
}
impl TIMOUTCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TIMOUTCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TIMOUTCFW<'a> {
w: &'a mut W,
}
impl<'a> _TIMOUTCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TIMOUTCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the TIMOUT flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(TIMOUTCFW::CLEAR)
}
#[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 &= !(0x01 << 12);
self.w.bits |= ((value as u32) & 0x01) << 12;
self.w
}
}
#[doc = "Values that can be written to the field `PECCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PECCFW {
#[doc = "Clears the PEC flag in ISR register"]
CLEAR,
}
impl PECCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
PECCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _PECCFW<'a> {
w: &'a mut W,
}
impl<'a> _PECCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PECCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the PEC flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(PECCFW::CLEAR)
}
#[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 &= !(0x01 << 11);
self.w.bits |= ((value as u32) & 0x01) << 11;
self.w
}
}
#[doc = "Values that can be written to the field `OVRCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OVRCFW {
#[doc = "Clears the OVR flag in ISR register"]
CLEAR,
}
impl OVRCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
OVRCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _OVRCFW<'a> {
w: &'a mut W,
}
impl<'a> _OVRCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: OVRCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the OVR flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(OVRCFW::CLEAR)
}
#[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 &= !(0x01 << 10);
self.w.bits |= ((value as u32) & 0x01) << 10;
self.w
}
}
#[doc = "Values that can be written to the field `ARLOCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ARLOCFW {
#[doc = "Clears the ARLO flag in ISR register"]
CLEAR,
}
impl ARLOCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ARLOCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ARLOCFW<'a> {
w: &'a mut W,
}
impl<'a> _ARLOCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ARLOCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the ARLO flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(ARLOCFW::CLEAR)
}
#[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 &= !(0x01 << 9);
self.w.bits |= ((value as u32) & 0x01) << 9;
self.w
}
}
#[doc = "Values that can be written to the field `BERRCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BERRCFW {
#[doc = "Clears the BERR flag in ISR register"]
CLEAR,
}
impl BERRCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
BERRCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _BERRCFW<'a> {
w: &'a mut W,
}
impl<'a> _BERRCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: BERRCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the BERR flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(BERRCFW::CLEAR)
}
#[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 &= !(0x01 << 8);
self.w.bits |= ((value as u32) & 0x01) << 8;
self.w
}
}
#[doc = "Values that can be written to the field `STOPCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STOPCFW {
#[doc = "Clears the STOP flag in ISR register"]
CLEAR,
}
impl STOPCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
STOPCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _STOPCFW<'a> {
w: &'a mut W,
}
impl<'a> _STOPCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: STOPCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the STOP flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(STOPCFW::CLEAR)
}
#[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 &= !(0x01 << 5);
self.w.bits |= ((value as u32) & 0x01) << 5;
self.w
}
}
#[doc = "Values that can be written to the field `NACKCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NACKCFW {
#[doc = "Clears the NACK flag in ISR register"]
CLEAR,
}
impl NACKCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
NACKCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _NACKCFW<'a> {
w: &'a mut W,
}
impl<'a> _NACKCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: NACKCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the NACK flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(NACKCFW::CLEAR)
}
#[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 &= !(0x01 << 4);
self.w.bits |= ((value as u32) & 0x01) << 4;
self.w
}
}
#[doc = "Values that can be written to the field `ADDRCF`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ADDRCFW {
#[doc = "Clears the ADDR flag in ISR register"]
CLEAR,
}
impl ADDRCFW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ADDRCFW::CLEAR => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ADDRCFW<'a> {
w: &'a mut W,
}
impl<'a> _ADDRCFW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ADDRCFW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clears the ADDR flag in ISR register"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(ADDRCFW::CLEAR)
}
#[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 &= !(0x01 << 3);
self.w.bits |= ((value as u32) & 0x01) << 3;
self.w
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 13 - Alert flag clear"]
#[inline(always)]
pub fn alertcf(&mut self) -> _ALERTCFW {
_ALERTCFW { w: self }
}
#[doc = "Bit 12 - Timeout detection flag clear"]
#[inline(always)]
pub fn timoutcf(&mut self) -> _TIMOUTCFW {
_TIMOUTCFW { w: self }
}
#[doc = "Bit 11 - PEC Error flag clear"]
#[inline(always)]
pub fn peccf(&mut self) -> _PECCFW {
_PECCFW { w: self }
}
#[doc = "Bit 10 - Overrun/Underrun flag clear"]
#[inline(always)]
pub fn ovrcf(&mut self) -> _OVRCFW {
_OVRCFW { w: self }
}
#[doc = "Bit 9 - Arbitration lost flag clear"]
#[inline(always)]
pub fn arlocf(&mut self) -> _ARLOCFW {
_ARLOCFW { w: self }
}
#[doc = "Bit 8 - Bus error flag clear"]
#[inline(always)]
pub fn berrcf(&mut self) -> _BERRCFW {
_BERRCFW { w: self }
}
#[doc = "Bit 5 - Stop detection flag clear"]
#[inline(always)]
pub fn stopcf(&mut self) -> _STOPCFW {
_STOPCFW { w: self }
}
#[doc = "Bit 4 - Not Acknowledge flag clear"]
#[inline(always)]
pub fn nackcf(&mut self) -> _NACKCFW {
_NACKCFW { w: self }
}
#[doc = "Bit 3 - Address Matched flag clear"]
#[inline(always)]
pub fn addrcf(&mut self) -> _ADDRCFW {
_ADDRCFW { w: self }
}
}