#[doc = "Register `BC` writer"]
pub struct W(crate::W<BC_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<BC_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<BC_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<BC_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Port cleat bit 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CR0_AW {
#[doc = "1: Resets the corresponding OCTLx bit"]
RESET = 1,
}
impl From<CR0_AW> for bool {
#[inline(always)]
fn from(variant: CR0_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `CR0` writer - Port cleat bit 0"]
pub struct CR0_W<'a> {
w: &'a mut W,
}
impl<'a> CR0_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR0_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR0_AW::RESET)
}
#[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
}
}
#[doc = "Port cleat bit 1"]
pub type CR1_AW = CR0_AW;
#[doc = "Field `CR1` writer - Port cleat bit 1"]
pub struct CR1_W<'a> {
w: &'a mut W,
}
impl<'a> CR1_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR1_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR1_AW::RESET)
}
#[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 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Port cleat bit 2"]
pub type CR2_AW = CR0_AW;
#[doc = "Field `CR2` writer - Port cleat bit 2"]
pub struct CR2_W<'a> {
w: &'a mut W,
}
impl<'a> CR2_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR2_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR2_AW::RESET)
}
#[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 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Port cleat bit 3"]
pub type CR3_AW = CR0_AW;
#[doc = "Field `CR3` writer - Port cleat bit 3"]
pub struct CR3_W<'a> {
w: &'a mut W,
}
impl<'a> CR3_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR3_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR3_AW::RESET)
}
#[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 = "Port cleat bit 4"]
pub type CR4_AW = CR0_AW;
#[doc = "Field `CR4` writer - Port cleat bit 4"]
pub struct CR4_W<'a> {
w: &'a mut W,
}
impl<'a> CR4_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR4_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR4_AW::RESET)
}
#[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 = "Port cleat bit 5"]
pub type CR5_AW = CR0_AW;
#[doc = "Field `CR5` writer - Port cleat bit 5"]
pub struct CR5_W<'a> {
w: &'a mut W,
}
impl<'a> CR5_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR5_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR5_AW::RESET)
}
#[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 = "Port cleat bit 6"]
pub type CR6_AW = CR0_AW;
#[doc = "Field `CR6` writer - Port cleat bit 6"]
pub struct CR6_W<'a> {
w: &'a mut W,
}
impl<'a> CR6_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR6_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR6_AW::RESET)
}
#[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 << 6)) | ((value as u32 & 0x01) << 6);
self.w
}
}
#[doc = "Port cleat bit 7"]
pub type CR7_AW = CR0_AW;
#[doc = "Field `CR7` writer - Port cleat bit 7"]
pub struct CR7_W<'a> {
w: &'a mut W,
}
impl<'a> CR7_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR7_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR7_AW::RESET)
}
#[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 << 7)) | ((value as u32 & 0x01) << 7);
self.w
}
}
#[doc = "Port cleat bit 8"]
pub type CR8_AW = CR0_AW;
#[doc = "Field `CR8` writer - Port cleat bit 8"]
pub struct CR8_W<'a> {
w: &'a mut W,
}
impl<'a> CR8_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR8_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR8_AW::RESET)
}
#[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 = "Port cleat bit 9"]
pub type CR9_AW = CR0_AW;
#[doc = "Field `CR9` writer - Port cleat bit 9"]
pub struct CR9_W<'a> {
w: &'a mut W,
}
impl<'a> CR9_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR9_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR9_AW::RESET)
}
#[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 = "Port cleat bit 10"]
pub type CR10_AW = CR0_AW;
#[doc = "Field `CR10` writer - Port cleat bit 10"]
pub struct CR10_W<'a> {
w: &'a mut W,
}
impl<'a> CR10_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR10_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR10_AW::RESET)
}
#[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 = "Port cleat bit 11"]
pub type CR11_AW = CR0_AW;
#[doc = "Field `CR11` writer - Port cleat bit 11"]
pub struct CR11_W<'a> {
w: &'a mut W,
}
impl<'a> CR11_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR11_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR11_AW::RESET)
}
#[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 = "Port cleat bit 12"]
pub type CR12_AW = CR0_AW;
#[doc = "Field `CR12` writer - Port cleat bit 12"]
pub struct CR12_W<'a> {
w: &'a mut W,
}
impl<'a> CR12_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR12_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR12_AW::RESET)
}
#[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 = "Port cleat bit 13"]
pub type CR13_AW = CR0_AW;
#[doc = "Field `CR13` writer - Port cleat bit 13"]
pub struct CR13_W<'a> {
w: &'a mut W,
}
impl<'a> CR13_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR13_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR13_AW::RESET)
}
#[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
}
}
#[doc = "Port cleat bit 14"]
pub type CR14_AW = CR0_AW;
#[doc = "Field `CR14` writer - Port cleat bit 14"]
pub struct CR14_W<'a> {
w: &'a mut W,
}
impl<'a> CR14_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR14_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR14_AW::RESET)
}
#[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 << 14)) | ((value as u32 & 0x01) << 14);
self.w
}
}
#[doc = "Port cleat bit 15"]
pub type CR15_AW = CR0_AW;
#[doc = "Field `CR15` writer - Port cleat bit 15"]
pub struct CR15_W<'a> {
w: &'a mut W,
}
impl<'a> CR15_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR15_AW) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "Resets the corresponding OCTLx bit"]
#[inline(always)]
pub fn reset(self) -> &'a mut W {
self.variant(CR15_AW::RESET)
}
#[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 << 15)) | ((value as u32 & 0x01) << 15);
self.w
}
}
impl W {
#[doc = "Bit 0 - Port cleat bit 0"]
#[inline(always)]
pub fn cr0(&mut self) -> CR0_W {
CR0_W { w: self }
}
#[doc = "Bit 1 - Port cleat bit 1"]
#[inline(always)]
pub fn cr1(&mut self) -> CR1_W {
CR1_W { w: self }
}
#[doc = "Bit 2 - Port cleat bit 2"]
#[inline(always)]
pub fn cr2(&mut self) -> CR2_W {
CR2_W { w: self }
}
#[doc = "Bit 3 - Port cleat bit 3"]
#[inline(always)]
pub fn cr3(&mut self) -> CR3_W {
CR3_W { w: self }
}
#[doc = "Bit 4 - Port cleat bit 4"]
#[inline(always)]
pub fn cr4(&mut self) -> CR4_W {
CR4_W { w: self }
}
#[doc = "Bit 5 - Port cleat bit 5"]
#[inline(always)]
pub fn cr5(&mut self) -> CR5_W {
CR5_W { w: self }
}
#[doc = "Bit 6 - Port cleat bit 6"]
#[inline(always)]
pub fn cr6(&mut self) -> CR6_W {
CR6_W { w: self }
}
#[doc = "Bit 7 - Port cleat bit 7"]
#[inline(always)]
pub fn cr7(&mut self) -> CR7_W {
CR7_W { w: self }
}
#[doc = "Bit 8 - Port cleat bit 8"]
#[inline(always)]
pub fn cr8(&mut self) -> CR8_W {
CR8_W { w: self }
}
#[doc = "Bit 9 - Port cleat bit 9"]
#[inline(always)]
pub fn cr9(&mut self) -> CR9_W {
CR9_W { w: self }
}
#[doc = "Bit 10 - Port cleat bit 10"]
#[inline(always)]
pub fn cr10(&mut self) -> CR10_W {
CR10_W { w: self }
}
#[doc = "Bit 11 - Port cleat bit 11"]
#[inline(always)]
pub fn cr11(&mut self) -> CR11_W {
CR11_W { w: self }
}
#[doc = "Bit 12 - Port cleat bit 12"]
#[inline(always)]
pub fn cr12(&mut self) -> CR12_W {
CR12_W { w: self }
}
#[doc = "Bit 13 - Port cleat bit 13"]
#[inline(always)]
pub fn cr13(&mut self) -> CR13_W {
CR13_W { w: self }
}
#[doc = "Bit 14 - Port cleat bit 14"]
#[inline(always)]
pub fn cr14(&mut self) -> CR14_W {
CR14_W { w: self }
}
#[doc = "Bit 15 - Port cleat bit 15"]
#[inline(always)]
pub fn cr15(&mut self) -> CR15_W {
CR15_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 = "Port bit reset register\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 [bc](index.html) module"]
pub struct BC_SPEC;
impl crate::RegisterSpec for BC_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [bc::W](W) writer structure"]
impl crate::Writable for BC_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets BC to value 0"]
impl crate::Resettable for BC_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}