stm32f1_staging/stm32f103/can1/
tsr.rspub type R = crate::R<TSRrs>;
pub type W = crate::W<TSRrs>;
pub type RQCP0_R = crate::BitReader;
pub type RQCP0_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TXOK0_R = crate::BitReader;
pub type TXOK0_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ALST0_R = crate::BitReader;
pub type ALST0_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TERR0_R = crate::BitReader;
pub type TERR0_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ABRQ0_R = crate::BitReader;
pub type ABRQ0_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RQCP1_R = crate::BitReader;
pub type RQCP1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TXOK1_R = crate::BitReader;
pub type TXOK1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ALST1_R = crate::BitReader;
pub type ALST1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TERR1_R = crate::BitReader;
pub type TERR1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ABRQ1_R = crate::BitReader;
pub type ABRQ1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RQCP2_R = crate::BitReader;
pub type RQCP2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TXOK2_R = crate::BitReader;
pub type TXOK2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ALST2_R = crate::BitReader;
pub type ALST2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TERR2_R = crate::BitReader;
pub type TERR2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ABRQ2_R = crate::BitReader;
pub type ABRQ2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CODE_R = crate::FieldReader;
pub type TME_R = crate::BitReader;
pub type LOW_R = crate::BitReader;
impl R {
#[inline(always)]
pub fn rqcp0(&self) -> RQCP0_R {
RQCP0_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn txok0(&self) -> TXOK0_R {
TXOK0_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn alst0(&self) -> ALST0_R {
ALST0_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn terr0(&self) -> TERR0_R {
TERR0_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn abrq0(&self) -> ABRQ0_R {
ABRQ0_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn rqcp1(&self) -> RQCP1_R {
RQCP1_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn txok1(&self) -> TXOK1_R {
TXOK1_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn alst1(&self) -> ALST1_R {
ALST1_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn terr1(&self) -> TERR1_R {
TERR1_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn abrq1(&self) -> ABRQ1_R {
ABRQ1_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn rqcp2(&self) -> RQCP2_R {
RQCP2_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn txok2(&self) -> TXOK2_R {
TXOK2_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn alst2(&self) -> ALST2_R {
ALST2_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn terr2(&self) -> TERR2_R {
TERR2_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn abrq2(&self) -> ABRQ2_R {
ABRQ2_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn code(&self) -> CODE_R {
CODE_R::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn tme(&self, n: u8) -> TME_R {
#[allow(clippy::no_effect)]
[(); 3][n as usize];
TME_R::new(((self.bits >> (n + 26)) & 1) != 0)
}
#[inline(always)]
pub fn tme_iter(&self) -> impl Iterator<Item = TME_R> + '_ {
(0..3).map(move |n| TME_R::new(((self.bits >> (n + 26)) & 1) != 0))
}
#[inline(always)]
pub fn tme0(&self) -> TME_R {
TME_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn tme1(&self) -> TME_R {
TME_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn tme2(&self) -> TME_R {
TME_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn low(&self, n: u8) -> LOW_R {
#[allow(clippy::no_effect)]
[(); 3][n as usize];
LOW_R::new(((self.bits >> (n + 29)) & 1) != 0)
}
#[inline(always)]
pub fn low_iter(&self) -> impl Iterator<Item = LOW_R> + '_ {
(0..3).map(move |n| LOW_R::new(((self.bits >> (n + 29)) & 1) != 0))
}
#[inline(always)]
pub fn low0(&self) -> LOW_R {
LOW_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn low1(&self) -> LOW_R {
LOW_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn low2(&self) -> LOW_R {
LOW_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TSR")
.field("low0", &self.low0())
.field("low1", &self.low1())
.field("low2", &self.low2())
.field("tme0", &self.tme0())
.field("tme1", &self.tme1())
.field("tme2", &self.tme2())
.field("code", &self.code())
.field("abrq2", &self.abrq2())
.field("terr2", &self.terr2())
.field("alst2", &self.alst2())
.field("txok2", &self.txok2())
.field("rqcp2", &self.rqcp2())
.field("abrq1", &self.abrq1())
.field("terr1", &self.terr1())
.field("alst1", &self.alst1())
.field("txok1", &self.txok1())
.field("rqcp1", &self.rqcp1())
.field("abrq0", &self.abrq0())
.field("terr0", &self.terr0())
.field("alst0", &self.alst0())
.field("txok0", &self.txok0())
.field("rqcp0", &self.rqcp0())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn rqcp0(&mut self) -> RQCP0_W<TSRrs> {
RQCP0_W::new(self, 0)
}
#[inline(always)]
#[must_use]
pub fn txok0(&mut self) -> TXOK0_W<TSRrs> {
TXOK0_W::new(self, 1)
}
#[inline(always)]
#[must_use]
pub fn alst0(&mut self) -> ALST0_W<TSRrs> {
ALST0_W::new(self, 2)
}
#[inline(always)]
#[must_use]
pub fn terr0(&mut self) -> TERR0_W<TSRrs> {
TERR0_W::new(self, 3)
}
#[inline(always)]
#[must_use]
pub fn abrq0(&mut self) -> ABRQ0_W<TSRrs> {
ABRQ0_W::new(self, 7)
}
#[inline(always)]
#[must_use]
pub fn rqcp1(&mut self) -> RQCP1_W<TSRrs> {
RQCP1_W::new(self, 8)
}
#[inline(always)]
#[must_use]
pub fn txok1(&mut self) -> TXOK1_W<TSRrs> {
TXOK1_W::new(self, 9)
}
#[inline(always)]
#[must_use]
pub fn alst1(&mut self) -> ALST1_W<TSRrs> {
ALST1_W::new(self, 10)
}
#[inline(always)]
#[must_use]
pub fn terr1(&mut self) -> TERR1_W<TSRrs> {
TERR1_W::new(self, 11)
}
#[inline(always)]
#[must_use]
pub fn abrq1(&mut self) -> ABRQ1_W<TSRrs> {
ABRQ1_W::new(self, 15)
}
#[inline(always)]
#[must_use]
pub fn rqcp2(&mut self) -> RQCP2_W<TSRrs> {
RQCP2_W::new(self, 16)
}
#[inline(always)]
#[must_use]
pub fn txok2(&mut self) -> TXOK2_W<TSRrs> {
TXOK2_W::new(self, 17)
}
#[inline(always)]
#[must_use]
pub fn alst2(&mut self) -> ALST2_W<TSRrs> {
ALST2_W::new(self, 18)
}
#[inline(always)]
#[must_use]
pub fn terr2(&mut self) -> TERR2_W<TSRrs> {
TERR2_W::new(self, 19)
}
#[inline(always)]
#[must_use]
pub fn abrq2(&mut self) -> ABRQ2_W<TSRrs> {
ABRQ2_W::new(self, 23)
}
}
pub struct TSRrs;
impl crate::RegisterSpec for TSRrs {
type Ux = u32;
}
impl crate::Readable for TSRrs {}
impl crate::Writable for TSRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for TSRrs {
const RESET_VALUE: u32 = 0;
}