#[doc = "Register `SR` reader"]
pub struct R(crate::R<SR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SR` writer"]
pub struct W(crate::W<SR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SR_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<SR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `CC2OF` reader - Capture/compare 2 overcapture flag"]
pub struct CC2OF_R(crate::FieldReader<bool, bool>);
impl CC2OF_R {
pub(crate) fn new(bits: bool) -> Self {
CC2OF_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CC2OF_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CC2OF` writer - Capture/compare 2 overcapture flag"]
pub struct CC2OF_W<'a> {
w: &'a mut W,
}
impl<'a> CC2OF_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 `CC1OF` reader - Capture/Compare 1 overcapture flag"]
pub struct CC1OF_R(crate::FieldReader<bool, bool>);
impl CC1OF_R {
pub(crate) fn new(bits: bool) -> Self {
CC1OF_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CC1OF_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CC1OF` writer - Capture/Compare 1 overcapture flag"]
pub struct CC1OF_W<'a> {
w: &'a mut W,
}
impl<'a> CC1OF_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 `BIF` reader - Break interrupt flag"]
pub struct BIF_R(crate::FieldReader<bool, bool>);
impl BIF_R {
pub(crate) fn new(bits: bool) -> Self {
BIF_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for BIF_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `BIF` writer - Break interrupt flag"]
pub struct BIF_W<'a> {
w: &'a mut W,
}
impl<'a> BIF_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 << 7)) | ((value as u32 & 0x01) << 7);
self.w
}
}
#[doc = "Field `TIF` reader - Trigger interrupt flag"]
pub struct TIF_R(crate::FieldReader<bool, bool>);
impl TIF_R {
pub(crate) fn new(bits: bool) -> Self {
TIF_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TIF_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TIF` writer - Trigger interrupt flag"]
pub struct TIF_W<'a> {
w: &'a mut W,
}
impl<'a> TIF_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 << 6)) | ((value as u32 & 0x01) << 6);
self.w
}
}
#[doc = "Field `COMIF` reader - COM interrupt flag"]
pub struct COMIF_R(crate::FieldReader<bool, bool>);
impl COMIF_R {
pub(crate) fn new(bits: bool) -> Self {
COMIF_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for COMIF_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `COMIF` writer - COM interrupt flag"]
pub struct COMIF_W<'a> {
w: &'a mut W,
}
impl<'a> COMIF_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 `CC2IF` reader - Capture/Compare 2 interrupt flag"]
pub struct CC2IF_R(crate::FieldReader<bool, bool>);
impl CC2IF_R {
pub(crate) fn new(bits: bool) -> Self {
CC2IF_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CC2IF_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CC2IF` writer - Capture/Compare 2 interrupt flag"]
pub struct CC2IF_W<'a> {
w: &'a mut W,
}
impl<'a> CC2IF_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 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Field `CC1IF` reader - Capture/compare 1 interrupt flag"]
pub struct CC1IF_R(crate::FieldReader<bool, bool>);
impl CC1IF_R {
pub(crate) fn new(bits: bool) -> Self {
CC1IF_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CC1IF_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CC1IF` writer - Capture/compare 1 interrupt flag"]
pub struct CC1IF_W<'a> {
w: &'a mut W,
}
impl<'a> CC1IF_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 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Update interrupt flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum UIF_A {
#[doc = "0: No update occurred"]
CLEAR = 0,
#[doc = "1: Update interrupt pending."]
UPDATEPENDING = 1,
}
impl From<UIF_A> for bool {
#[inline(always)]
fn from(variant: UIF_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `UIF` reader - Update interrupt flag"]
pub struct UIF_R(crate::FieldReader<bool, UIF_A>);
impl UIF_R {
pub(crate) fn new(bits: bool) -> Self {
UIF_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> UIF_A {
match self.bits {
false => UIF_A::CLEAR,
true => UIF_A::UPDATEPENDING,
}
}
#[doc = "Checks if the value of the field is `CLEAR`"]
#[inline(always)]
pub fn is_clear(&self) -> bool {
**self == UIF_A::CLEAR
}
#[doc = "Checks if the value of the field is `UPDATEPENDING`"]
#[inline(always)]
pub fn is_update_pending(&self) -> bool {
**self == UIF_A::UPDATEPENDING
}
}
impl core::ops::Deref for UIF_R {
type Target = crate::FieldReader<bool, UIF_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `UIF` writer - Update interrupt flag"]
pub struct UIF_W<'a> {
w: &'a mut W,
}
impl<'a> UIF_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: UIF_A) -> &'a mut W {
self.bit(variant.into())
}
#[doc = "No update occurred"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(UIF_A::CLEAR)
}
#[doc = "Update interrupt pending."]
#[inline(always)]
pub fn update_pending(self) -> &'a mut W {
self.variant(UIF_A::UPDATEPENDING)
}
#[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 = "Bit 10 - Capture/compare 2 overcapture flag"]
#[inline(always)]
pub fn cc2of(&self) -> CC2OF_R {
CC2OF_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 9 - Capture/Compare 1 overcapture flag"]
#[inline(always)]
pub fn cc1of(&self) -> CC1OF_R {
CC1OF_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 7 - Break interrupt flag"]
#[inline(always)]
pub fn bif(&self) -> BIF_R {
BIF_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 6 - Trigger interrupt flag"]
#[inline(always)]
pub fn tif(&self) -> TIF_R {
TIF_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 5 - COM interrupt flag"]
#[inline(always)]
pub fn comif(&self) -> COMIF_R {
COMIF_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 2 - Capture/Compare 2 interrupt flag"]
#[inline(always)]
pub fn cc2if(&self) -> CC2IF_R {
CC2IF_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - Capture/compare 1 interrupt flag"]
#[inline(always)]
pub fn cc1if(&self) -> CC1IF_R {
CC1IF_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - Update interrupt flag"]
#[inline(always)]
pub fn uif(&self) -> UIF_R {
UIF_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 10 - Capture/compare 2 overcapture flag"]
#[inline(always)]
pub fn cc2of(&mut self) -> CC2OF_W {
CC2OF_W { w: self }
}
#[doc = "Bit 9 - Capture/Compare 1 overcapture flag"]
#[inline(always)]
pub fn cc1of(&mut self) -> CC1OF_W {
CC1OF_W { w: self }
}
#[doc = "Bit 7 - Break interrupt flag"]
#[inline(always)]
pub fn bif(&mut self) -> BIF_W {
BIF_W { w: self }
}
#[doc = "Bit 6 - Trigger interrupt flag"]
#[inline(always)]
pub fn tif(&mut self) -> TIF_W {
TIF_W { w: self }
}
#[doc = "Bit 5 - COM interrupt flag"]
#[inline(always)]
pub fn comif(&mut self) -> COMIF_W {
COMIF_W { w: self }
}
#[doc = "Bit 2 - Capture/Compare 2 interrupt flag"]
#[inline(always)]
pub fn cc2if(&mut self) -> CC2IF_W {
CC2IF_W { w: self }
}
#[doc = "Bit 1 - Capture/compare 1 interrupt flag"]
#[inline(always)]
pub fn cc1if(&mut self) -> CC1IF_W {
CC1IF_W { w: self }
}
#[doc = "Bit 0 - Update interrupt flag"]
#[inline(always)]
pub fn uif(&mut self) -> UIF_W {
UIF_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 = "status 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 [sr](index.html) module"]
pub struct SR_SPEC;
impl crate::RegisterSpec for SR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [sr::R](R) reader structure"]
impl crate::Readable for SR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [sr::W](W) writer structure"]
impl crate::Writable for SR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SR to value 0"]
impl crate::Resettable for SR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}