stm32f1_staging/stm32f107/can1/
rfr.rspub type R = crate::R<RFRrs>;
pub type W = crate::W<RFRrs>;
pub type FMP_R = crate::FieldReader;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FULL0R {
NotFull = 0,
Full = 1,
}
impl From<FULL0R> for bool {
#[inline(always)]
fn from(variant: FULL0R) -> Self {
variant as u8 != 0
}
}
pub type FULL_R = crate::BitReader<FULL0R>;
impl FULL_R {
#[inline(always)]
pub const fn variant(&self) -> FULL0R {
match self.bits {
false => FULL0R::NotFull,
true => FULL0R::Full,
}
}
#[inline(always)]
pub fn is_not_full(&self) -> bool {
*self == FULL0R::NotFull
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == FULL0R::Full
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FULL0W {
Clear = 1,
}
impl From<FULL0W> for bool {
#[inline(always)]
fn from(variant: FULL0W) -> Self {
variant as u8 != 0
}
}
pub type FULL_W<'a, REG> = crate::BitWriter<'a, REG, FULL0W>;
impl<'a, REG> FULL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(FULL0W::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FOVR0R {
NoOverrun = 0,
Overrun = 1,
}
impl From<FOVR0R> for bool {
#[inline(always)]
fn from(variant: FOVR0R) -> Self {
variant as u8 != 0
}
}
pub type FOVR_R = crate::BitReader<FOVR0R>;
impl FOVR_R {
#[inline(always)]
pub const fn variant(&self) -> FOVR0R {
match self.bits {
false => FOVR0R::NoOverrun,
true => FOVR0R::Overrun,
}
}
#[inline(always)]
pub fn is_no_overrun(&self) -> bool {
*self == FOVR0R::NoOverrun
}
#[inline(always)]
pub fn is_overrun(&self) -> bool {
*self == FOVR0R::Overrun
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FOVR0W {
Clear = 1,
}
impl From<FOVR0W> for bool {
#[inline(always)]
fn from(variant: FOVR0W) -> Self {
variant as u8 != 0
}
}
pub type FOVR_W<'a, REG> = crate::BitWriter<'a, REG, FOVR0W>;
impl<'a, REG> FOVR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(FOVR0W::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RFOM0W {
Release = 1,
}
impl From<RFOM0W> for bool {
#[inline(always)]
fn from(variant: RFOM0W) -> Self {
variant as u8 != 0
}
}
pub type RFOM_R = crate::BitReader<RFOM0W>;
impl RFOM_R {
#[inline(always)]
pub const fn variant(&self) -> Option<RFOM0W> {
match self.bits {
true => Some(RFOM0W::Release),
_ => None,
}
}
#[inline(always)]
pub fn is_release(&self) -> bool {
*self == RFOM0W::Release
}
}
pub type RFOM_W<'a, REG> = crate::BitWriter<'a, REG, RFOM0W>;
impl<'a, REG> RFOM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn release(self) -> &'a mut crate::W<REG> {
self.variant(RFOM0W::Release)
}
}
impl R {
#[inline(always)]
pub fn fmp(&self) -> FMP_R {
FMP_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn full(&self) -> FULL_R {
FULL_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn fovr(&self) -> FOVR_R {
FOVR_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn rfom(&self) -> RFOM_R {
RFOM_R::new(((self.bits >> 5) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("RFR")
.field("rfom", &self.rfom())
.field("fovr", &self.fovr())
.field("full", &self.full())
.field("fmp", &self.fmp())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn full(&mut self) -> FULL_W<RFRrs> {
FULL_W::new(self, 3)
}
#[inline(always)]
#[must_use]
pub fn fovr(&mut self) -> FOVR_W<RFRrs> {
FOVR_W::new(self, 4)
}
#[inline(always)]
#[must_use]
pub fn rfom(&mut self) -> RFOM_W<RFRrs> {
RFOM_W::new(self, 5)
}
}
pub struct RFRrs;
impl crate::RegisterSpec for RFRrs {
type Ux = u32;
}
impl crate::Readable for RFRrs {}
impl crate::Writable for RFRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for RFRrs {
const RESET_VALUE: u32 = 0;
}