pub type R = crate::R<CDSRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VDES {
NotActive = 0,
Active = 1,
}
impl From<VDES> for bool {
#[inline(always)]
fn from(variant: VDES) -> Self {
variant as u8 != 0
}
}
pub type VDES_R = crate::BitReader<VDES>;
impl VDES_R {
#[inline(always)]
pub const fn variant(&self) -> VDES {
match self.bits {
false => VDES::NotActive,
true => VDES::Active,
}
}
#[inline(always)]
pub fn is_not_active(&self) -> bool {
*self == VDES::NotActive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == VDES::Active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HDES {
NotActive = 0,
Active = 1,
}
impl From<HDES> for bool {
#[inline(always)]
fn from(variant: HDES) -> Self {
variant as u8 != 0
}
}
pub type HDES_R = crate::BitReader<HDES>;
impl HDES_R {
#[inline(always)]
pub const fn variant(&self) -> HDES {
match self.bits {
false => HDES::NotActive,
true => HDES::Active,
}
}
#[inline(always)]
pub fn is_not_active(&self) -> bool {
*self == HDES::NotActive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == HDES::Active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VSYNCS {
NotActive = 0,
Active = 1,
}
impl From<VSYNCS> for bool {
#[inline(always)]
fn from(variant: VSYNCS) -> Self {
variant as u8 != 0
}
}
pub type VSYNCS_R = crate::BitReader<VSYNCS>;
impl VSYNCS_R {
#[inline(always)]
pub const fn variant(&self) -> VSYNCS {
match self.bits {
false => VSYNCS::NotActive,
true => VSYNCS::Active,
}
}
#[inline(always)]
pub fn is_not_active(&self) -> bool {
*self == VSYNCS::NotActive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == VSYNCS::Active
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HSYNCS {
NotActive = 0,
Active = 1,
}
impl From<HSYNCS> for bool {
#[inline(always)]
fn from(variant: HSYNCS) -> Self {
variant as u8 != 0
}
}
pub type HSYNCS_R = crate::BitReader<HSYNCS>;
impl HSYNCS_R {
#[inline(always)]
pub const fn variant(&self) -> HSYNCS {
match self.bits {
false => HSYNCS::NotActive,
true => HSYNCS::Active,
}
}
#[inline(always)]
pub fn is_not_active(&self) -> bool {
*self == HSYNCS::NotActive
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == HSYNCS::Active
}
}
impl R {
#[inline(always)]
pub fn vdes(&self) -> VDES_R {
VDES_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn hdes(&self) -> HDES_R {
HDES_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn vsyncs(&self) -> VSYNCS_R {
VSYNCS_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn hsyncs(&self) -> HSYNCS_R {
HSYNCS_R::new(((self.bits >> 3) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CDSR")
.field("hsyncs", &self.hsyncs())
.field("vsyncs", &self.vsyncs())
.field("hdes", &self.hdes())
.field("vdes", &self.vdes())
.finish()
}
}
pub struct CDSRrs;
impl crate::RegisterSpec for CDSRrs {
type Ux = u32;
}
impl crate::Readable for CDSRrs {}
impl crate::Resettable for CDSRrs {
const RESET_VALUE: u32 = 0x0f;
}