Skip to main content

atsamd11c14a/nvmctrl/
intflag.rs

1#[doc = "Reader of register INTFLAG"]
2pub type R = crate::R<u8, super::INTFLAG>;
3#[doc = "Writer for register INTFLAG"]
4pub type W = crate::W<u8, super::INTFLAG>;
5#[doc = "Register INTFLAG `reset()`'s with value 0"]
6impl crate::ResetValue for super::INTFLAG {
7    type Type = u8;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `READY`"]
14pub type READY_R = crate::R<bool, bool>;
15#[doc = "Reader of field `ERROR`"]
16pub type ERROR_R = crate::R<bool, bool>;
17#[doc = "Write proxy for field `ERROR`"]
18pub struct ERROR_W<'a> {
19    w: &'a mut W,
20}
21impl<'a> ERROR_W<'a> {
22    #[doc = r"Sets the field bit"]
23    #[inline(always)]
24    pub fn set_bit(self) -> &'a mut W {
25        self.bit(true)
26    }
27    #[doc = r"Clears the field bit"]
28    #[inline(always)]
29    pub fn clear_bit(self) -> &'a mut W {
30        self.bit(false)
31    }
32    #[doc = r"Writes raw bits to the field"]
33    #[inline(always)]
34    pub fn bit(self, value: bool) -> &'a mut W {
35        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u8) & 0x01) << 1);
36        self.w
37    }
38}
39impl R {
40    #[doc = "Bit 0 - NVM Ready"]
41    #[inline(always)]
42    pub fn ready(&self) -> READY_R {
43        READY_R::new((self.bits & 0x01) != 0)
44    }
45    #[doc = "Bit 1 - Error"]
46    #[inline(always)]
47    pub fn error(&self) -> ERROR_R {
48        ERROR_R::new(((self.bits >> 1) & 0x01) != 0)
49    }
50}
51impl W {
52    #[doc = "Bit 1 - Error"]
53    #[inline(always)]
54    pub fn error(&mut self) -> ERROR_W {
55        ERROR_W { w: self }
56    }
57}