///Register `FDCAN_TOCC` reader
pub type R = crate::R<FDCAN_TOCCrs>;
///Register `FDCAN_TOCC` writer
pub type W = crate::W<FDCAN_TOCCrs>;
///Field `ETOC` reader - Timeout counter enable
pub type ETOC_R = crate::BitReader;
///Field `ETOC` writer - Timeout counter enable
pub type ETOC_W<'a, REG> = crate::BitWriter<'a, REG>;
///Field `TOS` reader - Timeout select
pub type TOS_R = crate::FieldReader;
///Field `TOS` writer - Timeout select
pub type TOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
///Field `TOP` reader - Timeout period
pub type TOP_R = crate::FieldReader<u16>;
///Field `TOP` writer - Timeout period
pub type TOP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
impl R {
    ///Bit 0 - Timeout counter enable
    #[inline(always)]
    pub fn etoc(&self) -> ETOC_R {
        ETOC_R::new((self.bits & 1) != 0)
    }
    ///Bits 1:2 - Timeout select
    #[inline(always)]
    pub fn tos(&self) -> TOS_R {
        TOS_R::new(((self.bits >> 1) & 3) as u8)
    }
    ///Bits 16:31 - Timeout period
    #[inline(always)]
    pub fn top(&self) -> TOP_R {
        TOP_R::new(((self.bits >> 16) & 0xffff) as u16)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("FDCAN_TOCC")
            .field("etoc", &self.etoc())
            .field("tos", &self.tos())
            .field("top", &self.top())
            .finish()
    }
}
impl W {
    ///Bit 0 - Timeout counter enable
    #[inline(always)]
    pub fn etoc(&mut self) -> ETOC_W<FDCAN_TOCCrs> {
        ETOC_W::new(self, 0)
    }
    ///Bits 1:2 - Timeout select
    #[inline(always)]
    pub fn tos(&mut self) -> TOS_W<FDCAN_TOCCrs> {
        TOS_W::new(self, 1)
    }
    ///Bits 16:31 - Timeout period
    #[inline(always)]
    pub fn top(&mut self) -> TOP_W<FDCAN_TOCCrs> {
        TOP_W::new(self, 16)
    }
}
/**FDCAN timeout counter configuration register

You can [`read`](crate::Reg::read) this register and get [`fdcan_tocc::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fdcan_tocc::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
pub struct FDCAN_TOCCrs;
impl crate::RegisterSpec for FDCAN_TOCCrs {
    type Ux = u32;
}
///`read()` method returns [`fdcan_tocc::R`](R) reader structure
impl crate::Readable for FDCAN_TOCCrs {}
///`write(|w| ..)` method takes [`fdcan_tocc::W`](W) writer structure
impl crate::Writable for FDCAN_TOCCrs {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
///`reset()` method sets FDCAN_TOCC to value 0xffff_0000
impl crate::Resettable for FDCAN_TOCCrs {
    const RESET_VALUE: u32 = 0xffff_0000;
}
