pub type R = crate::R<CRrs>;
pub type W = crate::W<CRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CAPTURE {
Disabled = 0,
Enabled = 1,
}
impl From<CAPTURE> for bool {
#[inline(always)]
fn from(variant: CAPTURE) -> Self {
variant as u8 != 0
}
}
pub type CAPTURE_R = crate::BitReader<CAPTURE>;
impl CAPTURE_R {
#[inline(always)]
pub const fn variant(&self) -> CAPTURE {
match self.bits {
false => CAPTURE::Disabled,
true => CAPTURE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CAPTURE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CAPTURE::Enabled
}
}
pub type CAPTURE_W<'a, REG> = crate::BitWriter<'a, REG, CAPTURE>;
impl<'a, REG> CAPTURE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CAPTURE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CAPTURE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CM {
Continuous = 0,
Snapshot = 1,
}
impl From<CM> for bool {
#[inline(always)]
fn from(variant: CM) -> Self {
variant as u8 != 0
}
}
pub type CM_R = crate::BitReader<CM>;
impl CM_R {
#[inline(always)]
pub const fn variant(&self) -> CM {
match self.bits {
false => CM::Continuous,
true => CM::Snapshot,
}
}
#[inline(always)]
pub fn is_continuous(&self) -> bool {
*self == CM::Continuous
}
#[inline(always)]
pub fn is_snapshot(&self) -> bool {
*self == CM::Snapshot
}
}
pub type CM_W<'a, REG> = crate::BitWriter<'a, REG, CM>;
impl<'a, REG> CM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn continuous(self) -> &'a mut crate::W<REG> {
self.variant(CM::Continuous)
}
#[inline(always)]
pub fn snapshot(self) -> &'a mut crate::W<REG> {
self.variant(CM::Snapshot)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CROP {
Full = 0,
Cropped = 1,
}
impl From<CROP> for bool {
#[inline(always)]
fn from(variant: CROP) -> Self {
variant as u8 != 0
}
}
pub type CROP_R = crate::BitReader<CROP>;
impl CROP_R {
#[inline(always)]
pub const fn variant(&self) -> CROP {
match self.bits {
false => CROP::Full,
true => CROP::Cropped,
}
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == CROP::Full
}
#[inline(always)]
pub fn is_cropped(&self) -> bool {
*self == CROP::Cropped
}
}
pub type CROP_W<'a, REG> = crate::BitWriter<'a, REG, CROP>;
impl<'a, REG> CROP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn full(self) -> &'a mut crate::W<REG> {
self.variant(CROP::Full)
}
#[inline(always)]
pub fn cropped(self) -> &'a mut crate::W<REG> {
self.variant(CROP::Cropped)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JPEG {
Uncompressed = 0,
Jpeg = 1,
}
impl From<JPEG> for bool {
#[inline(always)]
fn from(variant: JPEG) -> Self {
variant as u8 != 0
}
}
pub type JPEG_R = crate::BitReader<JPEG>;
impl JPEG_R {
#[inline(always)]
pub const fn variant(&self) -> JPEG {
match self.bits {
false => JPEG::Uncompressed,
true => JPEG::Jpeg,
}
}
#[inline(always)]
pub fn is_uncompressed(&self) -> bool {
*self == JPEG::Uncompressed
}
#[inline(always)]
pub fn is_jpeg(&self) -> bool {
*self == JPEG::Jpeg
}
}
pub type JPEG_W<'a, REG> = crate::BitWriter<'a, REG, JPEG>;
impl<'a, REG> JPEG_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn uncompressed(self) -> &'a mut crate::W<REG> {
self.variant(JPEG::Uncompressed)
}
#[inline(always)]
pub fn jpeg(self) -> &'a mut crate::W<REG> {
self.variant(JPEG::Jpeg)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ESS {
Hardware = 0,
Embedded = 1,
}
impl From<ESS> for bool {
#[inline(always)]
fn from(variant: ESS) -> Self {
variant as u8 != 0
}
}
pub type ESS_R = crate::BitReader<ESS>;
impl ESS_R {
#[inline(always)]
pub const fn variant(&self) -> ESS {
match self.bits {
false => ESS::Hardware,
true => ESS::Embedded,
}
}
#[inline(always)]
pub fn is_hardware(&self) -> bool {
*self == ESS::Hardware
}
#[inline(always)]
pub fn is_embedded(&self) -> bool {
*self == ESS::Embedded
}
}
pub type ESS_W<'a, REG> = crate::BitWriter<'a, REG, ESS>;
impl<'a, REG> ESS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn hardware(self) -> &'a mut crate::W<REG> {
self.variant(ESS::Hardware)
}
#[inline(always)]
pub fn embedded(self) -> &'a mut crate::W<REG> {
self.variant(ESS::Embedded)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PCKPOL {
FallingEdge = 0,
RisingEdge = 1,
}
impl From<PCKPOL> for bool {
#[inline(always)]
fn from(variant: PCKPOL) -> Self {
variant as u8 != 0
}
}
pub type PCKPOL_R = crate::BitReader<PCKPOL>;
impl PCKPOL_R {
#[inline(always)]
pub const fn variant(&self) -> PCKPOL {
match self.bits {
false => PCKPOL::FallingEdge,
true => PCKPOL::RisingEdge,
}
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == PCKPOL::FallingEdge
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == PCKPOL::RisingEdge
}
}
pub type PCKPOL_W<'a, REG> = crate::BitWriter<'a, REG, PCKPOL>;
impl<'a, REG> PCKPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(PCKPOL::FallingEdge)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(PCKPOL::RisingEdge)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HSPOL {
ActiveLow = 0,
ActiveHigh = 1,
}
impl From<HSPOL> for bool {
#[inline(always)]
fn from(variant: HSPOL) -> Self {
variant as u8 != 0
}
}
pub type HSPOL_R = crate::BitReader<HSPOL>;
impl HSPOL_R {
#[inline(always)]
pub const fn variant(&self) -> HSPOL {
match self.bits {
false => HSPOL::ActiveLow,
true => HSPOL::ActiveHigh,
}
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == HSPOL::ActiveLow
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == HSPOL::ActiveHigh
}
}
pub type HSPOL_W<'a, REG> = crate::BitWriter<'a, REG, HSPOL>;
impl<'a, REG> HSPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(HSPOL::ActiveLow)
}
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(HSPOL::ActiveHigh)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VSPOL {
ActiveLow = 0,
ActiveHigh = 1,
}
impl From<VSPOL> for bool {
#[inline(always)]
fn from(variant: VSPOL) -> Self {
variant as u8 != 0
}
}
pub type VSPOL_R = crate::BitReader<VSPOL>;
impl VSPOL_R {
#[inline(always)]
pub const fn variant(&self) -> VSPOL {
match self.bits {
false => VSPOL::ActiveLow,
true => VSPOL::ActiveHigh,
}
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == VSPOL::ActiveLow
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == VSPOL::ActiveHigh
}
}
pub type VSPOL_W<'a, REG> = crate::BitWriter<'a, REG, VSPOL>;
impl<'a, REG> VSPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(VSPOL::ActiveLow)
}
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(VSPOL::ActiveHigh)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FCRC {
All = 0,
Alternate = 1,
OneOfFour = 2,
}
impl From<FCRC> for u8 {
#[inline(always)]
fn from(variant: FCRC) -> Self {
variant as _
}
}
impl crate::FieldSpec for FCRC {
type Ux = u8;
}
impl crate::IsEnum for FCRC {}
pub type FCRC_R = crate::FieldReader<FCRC>;
impl FCRC_R {
#[inline(always)]
pub const fn variant(&self) -> Option<FCRC> {
match self.bits {
0 => Some(FCRC::All),
1 => Some(FCRC::Alternate),
2 => Some(FCRC::OneOfFour),
_ => None,
}
}
#[inline(always)]
pub fn is_all(&self) -> bool {
*self == FCRC::All
}
#[inline(always)]
pub fn is_alternate(&self) -> bool {
*self == FCRC::Alternate
}
#[inline(always)]
pub fn is_one_of_four(&self) -> bool {
*self == FCRC::OneOfFour
}
}
pub type FCRC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FCRC>;
impl<'a, REG> FCRC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn all(self) -> &'a mut crate::W<REG> {
self.variant(FCRC::All)
}
#[inline(always)]
pub fn alternate(self) -> &'a mut crate::W<REG> {
self.variant(FCRC::Alternate)
}
#[inline(always)]
pub fn one_of_four(self) -> &'a mut crate::W<REG> {
self.variant(FCRC::OneOfFour)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EDM {
BitWidth8 = 0,
BitWidth10 = 1,
BitWidth12 = 2,
BitWidth14 = 3,
}
impl From<EDM> for u8 {
#[inline(always)]
fn from(variant: EDM) -> Self {
variant as _
}
}
impl crate::FieldSpec for EDM {
type Ux = u8;
}
impl crate::IsEnum for EDM {}
pub type EDM_R = crate::FieldReader<EDM>;
impl EDM_R {
#[inline(always)]
pub const fn variant(&self) -> EDM {
match self.bits {
0 => EDM::BitWidth8,
1 => EDM::BitWidth10,
2 => EDM::BitWidth12,
3 => EDM::BitWidth14,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_bit_width8(&self) -> bool {
*self == EDM::BitWidth8
}
#[inline(always)]
pub fn is_bit_width10(&self) -> bool {
*self == EDM::BitWidth10
}
#[inline(always)]
pub fn is_bit_width12(&self) -> bool {
*self == EDM::BitWidth12
}
#[inline(always)]
pub fn is_bit_width14(&self) -> bool {
*self == EDM::BitWidth14
}
}
pub type EDM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EDM, crate::Safe>;
impl<'a, REG> EDM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn bit_width8(self) -> &'a mut crate::W<REG> {
self.variant(EDM::BitWidth8)
}
#[inline(always)]
pub fn bit_width10(self) -> &'a mut crate::W<REG> {
self.variant(EDM::BitWidth10)
}
#[inline(always)]
pub fn bit_width12(self) -> &'a mut crate::W<REG> {
self.variant(EDM::BitWidth12)
}
#[inline(always)]
pub fn bit_width14(self) -> &'a mut crate::W<REG> {
self.variant(EDM::BitWidth14)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ENABLE {
Disabled = 0,
Enabled = 1,
}
impl From<ENABLE> for bool {
#[inline(always)]
fn from(variant: ENABLE) -> Self {
variant as u8 != 0
}
}
pub type ENABLE_R = crate::BitReader<ENABLE>;
impl ENABLE_R {
#[inline(always)]
pub const fn variant(&self) -> ENABLE {
match self.bits {
false => ENABLE::Disabled,
true => ENABLE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ENABLE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ENABLE::Enabled
}
}
pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG, ENABLE>;
impl<'a, REG> ENABLE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ENABLE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ENABLE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn capture(&self) -> CAPTURE_R {
CAPTURE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cm(&self) -> CM_R {
CM_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn crop(&self) -> CROP_R {
CROP_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn jpeg(&self) -> JPEG_R {
JPEG_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn ess(&self) -> ESS_R {
ESS_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn pckpol(&self) -> PCKPOL_R {
PCKPOL_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn hspol(&self) -> HSPOL_R {
HSPOL_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn vspol(&self) -> VSPOL_R {
VSPOL_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn fcrc(&self) -> FCRC_R {
FCRC_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn edm(&self) -> EDM_R {
EDM_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn enable(&self) -> ENABLE_R {
ENABLE_R::new(((self.bits >> 14) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("enable", &self.enable())
.field("edm", &self.edm())
.field("fcrc", &self.fcrc())
.field("vspol", &self.vspol())
.field("hspol", &self.hspol())
.field("pckpol", &self.pckpol())
.field("ess", &self.ess())
.field("jpeg", &self.jpeg())
.field("crop", &self.crop())
.field("cm", &self.cm())
.field("capture", &self.capture())
.finish()
}
}
impl W {
#[inline(always)]
pub fn capture(&mut self) -> CAPTURE_W<CRrs> {
CAPTURE_W::new(self, 0)
}
#[inline(always)]
pub fn cm(&mut self) -> CM_W<CRrs> {
CM_W::new(self, 1)
}
#[inline(always)]
pub fn crop(&mut self) -> CROP_W<CRrs> {
CROP_W::new(self, 2)
}
#[inline(always)]
pub fn jpeg(&mut self) -> JPEG_W<CRrs> {
JPEG_W::new(self, 3)
}
#[inline(always)]
pub fn ess(&mut self) -> ESS_W<CRrs> {
ESS_W::new(self, 4)
}
#[inline(always)]
pub fn pckpol(&mut self) -> PCKPOL_W<CRrs> {
PCKPOL_W::new(self, 5)
}
#[inline(always)]
pub fn hspol(&mut self) -> HSPOL_W<CRrs> {
HSPOL_W::new(self, 6)
}
#[inline(always)]
pub fn vspol(&mut self) -> VSPOL_W<CRrs> {
VSPOL_W::new(self, 7)
}
#[inline(always)]
pub fn fcrc(&mut self) -> FCRC_W<CRrs> {
FCRC_W::new(self, 8)
}
#[inline(always)]
pub fn edm(&mut self) -> EDM_W<CRrs> {
EDM_W::new(self, 10)
}
#[inline(always)]
pub fn enable(&mut self) -> ENABLE_W<CRrs> {
ENABLE_W::new(self, 14)
}
}
pub struct CRrs;
impl crate::RegisterSpec for CRrs {
type Ux = u32;
}
impl crate::Readable for CRrs {}
impl crate::Writable for CRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CRrs {}