avr_device/devices/atmega4809/wdt/
status.rs1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<STATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `STATUS` writer"]
17pub struct W(crate::W<STATUS_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<STATUS_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<STATUS_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<STATUS_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `SYNCBUSY` reader - Syncronization busy"]
38pub type SYNCBUSY_R = crate::BitReader<bool>;
39#[doc = "Field `LOCK` reader - Lock enable"]
40pub type LOCK_R = crate::BitReader<bool>;
41#[doc = "Field `LOCK` writer - Lock enable"]
42pub type LOCK_W<'a, const O: u8> = crate::BitWriter<'a, u8, STATUS_SPEC, bool, O>;
43impl R {
44 #[doc = "Bit 0 - Syncronization busy"]
45 #[inline(always)]
46 pub fn syncbusy(&self) -> SYNCBUSY_R {
47 SYNCBUSY_R::new((self.bits & 1) != 0)
48 }
49 #[doc = "Bit 7 - Lock enable"]
50 #[inline(always)]
51 pub fn lock(&self) -> LOCK_R {
52 LOCK_R::new(((self.bits >> 7) & 1) != 0)
53 }
54}
55impl W {
56 #[doc = "Bit 7 - Lock enable"]
57 #[inline(always)]
58 #[must_use]
59 pub fn lock(&mut self) -> LOCK_W<7> {
60 LOCK_W::new(self)
61 }
62 #[doc = "Writes raw bits to the register."]
63 #[inline(always)]
64 pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
65 self.0.bits(bits);
66 self
67 }
68}
69#[doc = "Status\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 [status](index.html) module"]
70pub struct STATUS_SPEC;
71impl crate::RegisterSpec for STATUS_SPEC {
72 type Ux = u8;
73}
74#[doc = "`read()` method returns [status::R](R) reader structure"]
75impl crate::Readable for STATUS_SPEC {
76 type Reader = R;
77}
78#[doc = "`write(|w| ..)` method takes [status::W](W) writer structure"]
79impl crate::Writable for STATUS_SPEC {
80 type Writer = W;
81 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
82 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
83}
84#[doc = "`reset()` method sets STATUS to value 0"]
85impl crate::Resettable for STATUS_SPEC {
86 const RESET_VALUE: Self::Ux = 0;
87}