esp32c6/twai0/
err_warning_limit.rs

1#[doc = "Register `ERR_WARNING_LIMIT` reader"]
2pub type R = crate::R<ERR_WARNING_LIMIT_SPEC>;
3#[doc = "Register `ERR_WARNING_LIMIT` writer"]
4pub type W = crate::W<ERR_WARNING_LIMIT_SPEC>;
5#[doc = "Field `ERR_WARNING_LIMIT` reader - The threshold that trigger error warning interrupt when this interrupt is enabled. Software has R/W permission in reset mode and RO in operation mode."]
6pub type ERR_WARNING_LIMIT_R = crate::FieldReader;
7#[doc = "Field `ERR_WARNING_LIMIT` writer - The threshold that trigger error warning interrupt when this interrupt is enabled. Software has R/W permission in reset mode and RO in operation mode."]
8pub type ERR_WARNING_LIMIT_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9impl R {
10    #[doc = "Bits 0:7 - The threshold that trigger error warning interrupt when this interrupt is enabled. Software has R/W permission in reset mode and RO in operation mode."]
11    #[inline(always)]
12    pub fn err_warning_limit(&self) -> ERR_WARNING_LIMIT_R {
13        ERR_WARNING_LIMIT_R::new((self.bits & 0xff) as u8)
14    }
15}
16#[cfg(feature = "impl-register-debug")]
17impl core::fmt::Debug for R {
18    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
19        f.debug_struct("ERR_WARNING_LIMIT")
20            .field("err_warning_limit", &self.err_warning_limit())
21            .finish()
22    }
23}
24impl W {
25    #[doc = "Bits 0:7 - The threshold that trigger error warning interrupt when this interrupt is enabled. Software has R/W permission in reset mode and RO in operation mode."]
26    #[inline(always)]
27    pub fn err_warning_limit(&mut self) -> ERR_WARNING_LIMIT_W<ERR_WARNING_LIMIT_SPEC> {
28        ERR_WARNING_LIMIT_W::new(self, 0)
29    }
30}
31#[doc = "TWAI error threshold configuration register.\n\nYou can [`read`](crate::Reg::read) this register and get [`err_warning_limit::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`err_warning_limit::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
32pub struct ERR_WARNING_LIMIT_SPEC;
33impl crate::RegisterSpec for ERR_WARNING_LIMIT_SPEC {
34    type Ux = u32;
35}
36#[doc = "`read()` method returns [`err_warning_limit::R`](R) reader structure"]
37impl crate::Readable for ERR_WARNING_LIMIT_SPEC {}
38#[doc = "`write(|w| ..)` method takes [`err_warning_limit::W`](W) writer structure"]
39impl crate::Writable for ERR_WARNING_LIMIT_SPEC {
40    type Safety = crate::Unsafe;
41}
42#[doc = "`reset()` method sets ERR_WARNING_LIMIT to value 0x60"]
43impl crate::Resettable for ERR_WARNING_LIMIT_SPEC {
44    const RESET_VALUE: u32 = 0x60;
45}