pub type R = crate::R<CDCCIP1Rrs>;
pub type W = crate::W<CDCCIP1Rrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SAI1SEL {
Pll1Q = 0,
Pll2P = 1,
Pll3P = 2,
I2sCkin = 3,
Per = 4,
}
impl From<SAI1SEL> for u8 {
#[inline(always)]
fn from(variant: SAI1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SAI1SEL {
type Ux = u8;
}
impl crate::IsEnum for SAI1SEL {}
pub type SAI1SEL_R = crate::FieldReader<SAI1SEL>;
impl SAI1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SAI1SEL> {
match self.bits {
0 => Some(SAI1SEL::Pll1Q),
1 => Some(SAI1SEL::Pll2P),
2 => Some(SAI1SEL::Pll3P),
3 => Some(SAI1SEL::I2sCkin),
4 => Some(SAI1SEL::Per),
_ => None,
}
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == SAI1SEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == SAI1SEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_p(&self) -> bool {
*self == SAI1SEL::Pll3P
}
#[inline(always)]
pub fn is_i2s_ckin(&self) -> bool {
*self == SAI1SEL::I2sCkin
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == SAI1SEL::Per
}
}
pub type SAI1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SAI1SEL>;
impl<'a, REG> SAI1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pll1_q(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::Pll2P)
}
#[inline(always)]
pub fn pll3_p(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::Pll3P)
}
#[inline(always)]
pub fn i2s_ckin(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::I2sCkin)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::Per)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SAI2ASEL {
Pll1Q = 0,
Pll2P = 1,
Pll3P = 2,
I2sCkin = 3,
Per = 4,
}
impl From<SAI2ASEL> for u8 {
#[inline(always)]
fn from(variant: SAI2ASEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SAI2ASEL {
type Ux = u8;
}
impl crate::IsEnum for SAI2ASEL {}
pub type SAI2ASEL_R = crate::FieldReader<SAI2ASEL>;
impl SAI2ASEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SAI2ASEL> {
match self.bits {
0 => Some(SAI2ASEL::Pll1Q),
1 => Some(SAI2ASEL::Pll2P),
2 => Some(SAI2ASEL::Pll3P),
3 => Some(SAI2ASEL::I2sCkin),
4 => Some(SAI2ASEL::Per),
_ => None,
}
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == SAI2ASEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == SAI2ASEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_p(&self) -> bool {
*self == SAI2ASEL::Pll3P
}
#[inline(always)]
pub fn is_i2s_ckin(&self) -> bool {
*self == SAI2ASEL::I2sCkin
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == SAI2ASEL::Per
}
}
pub type SAI2ASEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SAI2ASEL>;
impl<'a, REG> SAI2ASEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pll1_q(self) -> &'a mut crate::W<REG> {
self.variant(SAI2ASEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(SAI2ASEL::Pll2P)
}
#[inline(always)]
pub fn pll3_p(self) -> &'a mut crate::W<REG> {
self.variant(SAI2ASEL::Pll3P)
}
#[inline(always)]
pub fn i2s_ckin(self) -> &'a mut crate::W<REG> {
self.variant(SAI2ASEL::I2sCkin)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(SAI2ASEL::Per)
}
}
pub use SAI1SEL_R as SPI123SEL_R;
pub use SAI1SEL_W as SPI123SEL_W;
pub use SAI2ASEL_R as SAI2BSEL_R;
pub use SAI2ASEL_W as SAI2BSEL_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SPI45SEL {
Apb = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
Hse = 5,
}
impl From<SPI45SEL> for u8 {
#[inline(always)]
fn from(variant: SPI45SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SPI45SEL {
type Ux = u8;
}
impl crate::IsEnum for SPI45SEL {}
pub type SPI45SEL_R = crate::FieldReader<SPI45SEL>;
impl SPI45SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SPI45SEL> {
match self.bits {
0 => Some(SPI45SEL::Apb),
1 => Some(SPI45SEL::Pll2Q),
2 => Some(SPI45SEL::Pll3Q),
3 => Some(SPI45SEL::HsiKer),
4 => Some(SPI45SEL::CsiKer),
5 => Some(SPI45SEL::Hse),
_ => None,
}
}
#[inline(always)]
pub fn is_apb(&self) -> bool {
*self == SPI45SEL::Apb
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == SPI45SEL::Pll2Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == SPI45SEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == SPI45SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == SPI45SEL::CsiKer
}
#[inline(always)]
pub fn is_hse(&self) -> bool {
*self == SPI45SEL::Hse
}
}
pub type SPI45SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SPI45SEL>;
impl<'a, REG> SPI45SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn apb(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::Apb)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::Pll2Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::Pll3Q)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::CsiKer)
}
#[inline(always)]
pub fn hse(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::Hse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SPDIFRXSEL {
Pll1Q = 0,
Pll2R = 1,
Pll3R = 2,
HsiKer = 3,
}
impl From<SPDIFRXSEL> for u8 {
#[inline(always)]
fn from(variant: SPDIFRXSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SPDIFRXSEL {
type Ux = u8;
}
impl crate::IsEnum for SPDIFRXSEL {}
pub type SPDIFRXSEL_R = crate::FieldReader<SPDIFRXSEL>;
impl SPDIFRXSEL_R {
#[inline(always)]
pub const fn variant(&self) -> SPDIFRXSEL {
match self.bits {
0 => SPDIFRXSEL::Pll1Q,
1 => SPDIFRXSEL::Pll2R,
2 => SPDIFRXSEL::Pll3R,
3 => SPDIFRXSEL::HsiKer,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == SPDIFRXSEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_r(&self) -> bool {
*self == SPDIFRXSEL::Pll2R
}
#[inline(always)]
pub fn is_pll3_r(&self) -> bool {
*self == SPDIFRXSEL::Pll3R
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == SPDIFRXSEL::HsiKer
}
}
pub type SPDIFRXSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SPDIFRXSEL, crate::Safe>;
impl<'a, REG> SPDIFRXSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pll1_q(self) -> &'a mut crate::W<REG> {
self.variant(SPDIFRXSEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_r(self) -> &'a mut crate::W<REG> {
self.variant(SPDIFRXSEL::Pll2R)
}
#[inline(always)]
pub fn pll3_r(self) -> &'a mut crate::W<REG> {
self.variant(SPDIFRXSEL::Pll3R)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(SPDIFRXSEL::HsiKer)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DFSDM1SEL {
RccPclk2 = 0,
Sys = 1,
}
impl From<DFSDM1SEL> for bool {
#[inline(always)]
fn from(variant: DFSDM1SEL) -> Self {
variant as u8 != 0
}
}
pub type DFSDM1SEL_R = crate::BitReader<DFSDM1SEL>;
impl DFSDM1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> DFSDM1SEL {
match self.bits {
false => DFSDM1SEL::RccPclk2,
true => DFSDM1SEL::Sys,
}
}
#[inline(always)]
pub fn is_rcc_pclk2(&self) -> bool {
*self == DFSDM1SEL::RccPclk2
}
#[inline(always)]
pub fn is_sys(&self) -> bool {
*self == DFSDM1SEL::Sys
}
}
pub type DFSDM1SEL_W<'a, REG> = crate::BitWriter<'a, REG, DFSDM1SEL>;
impl<'a, REG> DFSDM1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn rcc_pclk2(self) -> &'a mut crate::W<REG> {
self.variant(DFSDM1SEL::RccPclk2)
}
#[inline(always)]
pub fn sys(self) -> &'a mut crate::W<REG> {
self.variant(DFSDM1SEL::Sys)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FDCANSEL {
Hse = 0,
Pll1Q = 1,
Pll2Q = 2,
}
impl From<FDCANSEL> for u8 {
#[inline(always)]
fn from(variant: FDCANSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for FDCANSEL {
type Ux = u8;
}
impl crate::IsEnum for FDCANSEL {}
pub type FDCANSEL_R = crate::FieldReader<FDCANSEL>;
impl FDCANSEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<FDCANSEL> {
match self.bits {
0 => Some(FDCANSEL::Hse),
1 => Some(FDCANSEL::Pll1Q),
2 => Some(FDCANSEL::Pll2Q),
_ => None,
}
}
#[inline(always)]
pub fn is_hse(&self) -> bool {
*self == FDCANSEL::Hse
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == FDCANSEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == FDCANSEL::Pll2Q
}
}
pub type FDCANSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FDCANSEL>;
impl<'a, REG> FDCANSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn hse(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::Hse)
}
#[inline(always)]
pub fn pll1_q(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::Pll2Q)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SWPMISEL {
Pclk = 0,
HsiKer = 1,
}
impl From<SWPMISEL> for bool {
#[inline(always)]
fn from(variant: SWPMISEL) -> Self {
variant as u8 != 0
}
}
pub type SWPMISEL_R = crate::BitReader<SWPMISEL>;
impl SWPMISEL_R {
#[inline(always)]
pub const fn variant(&self) -> SWPMISEL {
match self.bits {
false => SWPMISEL::Pclk,
true => SWPMISEL::HsiKer,
}
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == SWPMISEL::Pclk
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == SWPMISEL::HsiKer
}
}
pub type SWPMISEL_W<'a, REG> = crate::BitWriter<'a, REG, SWPMISEL>;
impl<'a, REG> SWPMISEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn pclk(self) -> &'a mut crate::W<REG> {
self.variant(SWPMISEL::Pclk)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(SWPMISEL::HsiKer)
}
}
impl R {
#[inline(always)]
pub fn sai1sel(&self) -> SAI1SEL_R {
SAI1SEL_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn sai2asel(&self) -> SAI2ASEL_R {
SAI2ASEL_R::new(((self.bits >> 6) & 7) as u8)
}
#[inline(always)]
pub fn sai2bsel(&self) -> SAI2BSEL_R {
SAI2BSEL_R::new(((self.bits >> 9) & 7) as u8)
}
#[inline(always)]
pub fn spi123sel(&self) -> SPI123SEL_R {
SPI123SEL_R::new(((self.bits >> 12) & 7) as u8)
}
#[inline(always)]
pub fn spi45sel(&self) -> SPI45SEL_R {
SPI45SEL_R::new(((self.bits >> 16) & 7) as u8)
}
#[inline(always)]
pub fn spdifrxsel(&self) -> SPDIFRXSEL_R {
SPDIFRXSEL_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn dfsdm1sel(&self) -> DFSDM1SEL_R {
DFSDM1SEL_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn fdcansel(&self) -> FDCANSEL_R {
FDCANSEL_R::new(((self.bits >> 28) & 3) as u8)
}
#[inline(always)]
pub fn swpmisel(&self) -> SWPMISEL_R {
SWPMISEL_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CDCCIP1R")
.field("sai1sel", &self.sai1sel())
.field("sai2asel", &self.sai2asel())
.field("sai2bsel", &self.sai2bsel())
.field("spi123sel", &self.spi123sel())
.field("spi45sel", &self.spi45sel())
.field("spdifrxsel", &self.spdifrxsel())
.field("dfsdm1sel", &self.dfsdm1sel())
.field("fdcansel", &self.fdcansel())
.field("swpmisel", &self.swpmisel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sai1sel(&mut self) -> SAI1SEL_W<CDCCIP1Rrs> {
SAI1SEL_W::new(self, 0)
}
#[inline(always)]
pub fn sai2asel(&mut self) -> SAI2ASEL_W<CDCCIP1Rrs> {
SAI2ASEL_W::new(self, 6)
}
#[inline(always)]
pub fn sai2bsel(&mut self) -> SAI2BSEL_W<CDCCIP1Rrs> {
SAI2BSEL_W::new(self, 9)
}
#[inline(always)]
pub fn spi123sel(&mut self) -> SPI123SEL_W<CDCCIP1Rrs> {
SPI123SEL_W::new(self, 12)
}
#[inline(always)]
pub fn spi45sel(&mut self) -> SPI45SEL_W<CDCCIP1Rrs> {
SPI45SEL_W::new(self, 16)
}
#[inline(always)]
pub fn spdifrxsel(&mut self) -> SPDIFRXSEL_W<CDCCIP1Rrs> {
SPDIFRXSEL_W::new(self, 20)
}
#[inline(always)]
pub fn dfsdm1sel(&mut self) -> DFSDM1SEL_W<CDCCIP1Rrs> {
DFSDM1SEL_W::new(self, 24)
}
#[inline(always)]
pub fn fdcansel(&mut self) -> FDCANSEL_W<CDCCIP1Rrs> {
FDCANSEL_W::new(self, 28)
}
#[inline(always)]
pub fn swpmisel(&mut self) -> SWPMISEL_W<CDCCIP1Rrs> {
SWPMISEL_W::new(self, 31)
}
}
pub struct CDCCIP1Rrs;
impl crate::RegisterSpec for CDCCIP1Rrs {
type Ux = u32;
}
impl crate::Readable for CDCCIP1Rrs {}
impl crate::Writable for CDCCIP1Rrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CDCCIP1Rrs {}