pub type R = crate::R<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HSYNC {
ActiveLine = 0,
BetweenLines = 1,
}
impl From<HSYNC> for bool {
#[inline(always)]
fn from(variant: HSYNC) -> Self {
variant as u8 != 0
}
}
pub type HSYNC_R = crate::BitReader<HSYNC>;
impl HSYNC_R {
#[inline(always)]
pub const fn variant(&self) -> HSYNC {
match self.bits {
false => HSYNC::ActiveLine,
true => HSYNC::BetweenLines,
}
}
#[inline(always)]
pub fn is_active_line(&self) -> bool {
*self == HSYNC::ActiveLine
}
#[inline(always)]
pub fn is_between_lines(&self) -> bool {
*self == HSYNC::BetweenLines
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VSYNC {
ActiveFrame = 0,
BetweenFrames = 1,
}
impl From<VSYNC> for bool {
#[inline(always)]
fn from(variant: VSYNC) -> Self {
variant as u8 != 0
}
}
pub type VSYNC_R = crate::BitReader<VSYNC>;
impl VSYNC_R {
#[inline(always)]
pub const fn variant(&self) -> VSYNC {
match self.bits {
false => VSYNC::ActiveFrame,
true => VSYNC::BetweenFrames,
}
}
#[inline(always)]
pub fn is_active_frame(&self) -> bool {
*self == VSYNC::ActiveFrame
}
#[inline(always)]
pub fn is_between_frames(&self) -> bool {
*self == VSYNC::BetweenFrames
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FNE {
NotEmpty = 0,
Empty = 1,
}
impl From<FNE> for bool {
#[inline(always)]
fn from(variant: FNE) -> Self {
variant as u8 != 0
}
}
pub type FNE_R = crate::BitReader<FNE>;
impl FNE_R {
#[inline(always)]
pub const fn variant(&self) -> FNE {
match self.bits {
false => FNE::NotEmpty,
true => FNE::Empty,
}
}
#[inline(always)]
pub fn is_not_empty(&self) -> bool {
*self == FNE::NotEmpty
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == FNE::Empty
}
}
impl R {
#[inline(always)]
pub fn hsync(&self) -> HSYNC_R {
HSYNC_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn vsync(&self) -> VSYNC_R {
VSYNC_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn fne(&self) -> FNE_R {
FNE_R::new(((self.bits >> 2) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("fne", &self.fne())
.field("vsync", &self.vsync())
.field("hsync", &self.hsync())
.finish()
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Resettable for SRrs {}