Monorepo for Rust support of VA416XX family of radiation hardened MCUs
This commit is contained in:
55
va416xx/src/spw/tc.rs
Normal file
55
va416xx/src/spw/tc.rs
Normal file
@ -0,0 +1,55 @@
|
||||
#[doc = "Register `TC` reader"]
|
||||
pub type R = crate::R<TcSpec>;
|
||||
#[doc = "Register `TC` writer"]
|
||||
pub type W = crate::W<TcSpec>;
|
||||
#[doc = "Field `TIMECNT` reader - The current value of the system time counter"]
|
||||
pub type TimecntR = crate::FieldReader;
|
||||
#[doc = "Field `TIMECNT` writer - The current value of the system time counter"]
|
||||
pub type TimecntW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
|
||||
#[doc = "Field `TIRQ_END` reader - The current value of the time control flags"]
|
||||
pub type TirqEndR = crate::FieldReader;
|
||||
#[doc = "Field `TIRQ_END` writer - The current value of the time control flags"]
|
||||
pub type TirqEndW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:5 - The current value of the system time counter"]
|
||||
#[inline(always)]
|
||||
pub fn timecnt(&self) -> TimecntR {
|
||||
TimecntR::new((self.bits & 0x3f) as u8)
|
||||
}
|
||||
#[doc = "Bits 6:7 - The current value of the time control flags"]
|
||||
#[inline(always)]
|
||||
pub fn tirq_end(&self) -> TirqEndR {
|
||||
TirqEndR::new(((self.bits >> 6) & 3) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:5 - The current value of the system time counter"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn timecnt(&mut self) -> TimecntW<TcSpec> {
|
||||
TimecntW::new(self, 0)
|
||||
}
|
||||
#[doc = "Bits 6:7 - The current value of the time control flags"]
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn tirq_end(&mut self) -> TirqEndW<TcSpec> {
|
||||
TirqEndW::new(self, 6)
|
||||
}
|
||||
}
|
||||
#[doc = "Time Code Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
|
||||
pub struct TcSpec;
|
||||
impl crate::RegisterSpec for TcSpec {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [`tc::R`](R) reader structure"]
|
||||
impl crate::Readable for TcSpec {}
|
||||
#[doc = "`write(|w| ..)` method takes [`tc::W`](W) writer structure"]
|
||||
impl crate::Writable for TcSpec {
|
||||
type Safety = crate::Unsafe;
|
||||
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
|
||||
}
|
||||
#[doc = "`reset()` method sets TC to value 0"]
|
||||
impl crate::Resettable for TcSpec {
|
||||
const RESET_VALUE: u32 = 0;
|
||||
}
|
Reference in New Issue
Block a user