pub type R = crate::R<BFCRrs>;
pub type W = crate::W<BFCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum BF2 {
Constant = 5,
Pixel = 7,
}
impl From<BF2> for u8 {
#[inline(always)]
fn from(variant: BF2) -> Self {
variant as _
}
}
impl crate::FieldSpec for BF2 {
type Ux = u8;
}
impl crate::IsEnum for BF2 {}
pub type BF2_R = crate::FieldReader<BF2>;
impl BF2_R {
#[inline(always)]
pub const fn variant(&self) -> Option<BF2> {
match self.bits {
5 => Some(BF2::Constant),
7 => Some(BF2::Pixel),
_ => None,
}
}
#[inline(always)]
pub fn is_constant(&self) -> bool {
*self == BF2::Constant
}
#[inline(always)]
pub fn is_pixel(&self) -> bool {
*self == BF2::Pixel
}
}
pub type BF2_W<'a, REG> = crate::FieldWriter<'a, REG, 3, BF2>;
impl<'a, REG> BF2_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn constant(self) -> &'a mut crate::W<REG> {
self.variant(BF2::Constant)
}
#[inline(always)]
pub fn pixel(self) -> &'a mut crate::W<REG> {
self.variant(BF2::Pixel)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum BF1 {
Constant = 4,
Pixel = 6,
}
impl From<BF1> for u8 {
#[inline(always)]
fn from(variant: BF1) -> Self {
variant as _
}
}
impl crate::FieldSpec for BF1 {
type Ux = u8;
}
impl crate::IsEnum for BF1 {}
pub type BF1_R = crate::FieldReader<BF1>;
impl BF1_R {
#[inline(always)]
pub const fn variant(&self) -> Option<BF1> {
match self.bits {
4 => Some(BF1::Constant),
6 => Some(BF1::Pixel),
_ => None,
}
}
#[inline(always)]
pub fn is_constant(&self) -> bool {
*self == BF1::Constant
}
#[inline(always)]
pub fn is_pixel(&self) -> bool {
*self == BF1::Pixel
}
}
pub type BF1_W<'a, REG> = crate::FieldWriter<'a, REG, 3, BF1>;
impl<'a, REG> BF1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn constant(self) -> &'a mut crate::W<REG> {
self.variant(BF1::Constant)
}
#[inline(always)]
pub fn pixel(self) -> &'a mut crate::W<REG> {
self.variant(BF1::Pixel)
}
}
impl R {
#[inline(always)]
pub fn bf2(&self) -> BF2_R {
BF2_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn bf1(&self) -> BF1_R {
BF1_R::new(((self.bits >> 8) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("BFCR")
.field("bf1", &self.bf1())
.field("bf2", &self.bf2())
.finish()
}
}
impl W {
#[inline(always)]
pub fn bf2(&mut self) -> BF2_W<BFCRrs> {
BF2_W::new(self, 0)
}
#[inline(always)]
pub fn bf1(&mut self) -> BF1_W<BFCRrs> {
BF1_W::new(self, 8)
}
}
pub struct BFCRrs;
impl crate::RegisterSpec for BFCRrs {
type Ux = u32;
}
impl crate::Readable for BFCRrs {}
impl crate::Writable for BFCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for BFCRrs {
const RESET_VALUE: u32 = 0x0607;
}