pub type R = crate::R<CCIPR3rs>;
pub type W = crate::W<CCIPR3rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum USART1SEL {
Pclk2 = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
Lse = 5,
}
impl From<USART1SEL> for u8 {
#[inline(always)]
fn from(variant: USART1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for USART1SEL {
type Ux = u8;
}
impl crate::IsEnum for USART1SEL {}
pub type USART1SEL_R = crate::FieldReader<USART1SEL>;
impl USART1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<USART1SEL> {
match self.bits {
0 => Some(USART1SEL::Pclk2),
1 => Some(USART1SEL::Pll2Q),
2 => Some(USART1SEL::Pll3Q),
3 => Some(USART1SEL::HsiKer),
4 => Some(USART1SEL::CsiKer),
5 => Some(USART1SEL::Lse),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk2(&self) -> bool {
*self == USART1SEL::Pclk2
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == USART1SEL::Pll2Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == USART1SEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == USART1SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == USART1SEL::CsiKer
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == USART1SEL::Lse
}
}
pub type USART1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, USART1SEL>;
impl<'a, REG> USART1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk2(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Pclk2)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Pll2Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Pll3Q)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::CsiKer)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Lse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SPI45SEL {
Pclk2 = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
HseKer = 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::Pclk2),
1 => Some(SPI45SEL::Pll2Q),
2 => Some(SPI45SEL::Pll3Q),
3 => Some(SPI45SEL::HsiKer),
4 => Some(SPI45SEL::CsiKer),
5 => Some(SPI45SEL::HseKer),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk2(&self) -> bool {
*self == SPI45SEL::Pclk2
}
#[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_ker(&self) -> bool {
*self == SPI45SEL::HseKer
}
}
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 pclk2(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::Pclk2)
}
#[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_ker(self) -> &'a mut crate::W<REG> {
self.variant(SPI45SEL::HseKer)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SPI1SEL {
Pll1Q = 0,
Pll2P = 1,
Pll3P = 2,
I2sCkin = 3,
Per = 4,
}
impl From<SPI1SEL> for u8 {
#[inline(always)]
fn from(variant: SPI1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SPI1SEL {
type Ux = u8;
}
impl crate::IsEnum for SPI1SEL {}
pub type SPI1SEL_R = crate::FieldReader<SPI1SEL>;
impl SPI1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SPI1SEL> {
match self.bits {
0 => Some(SPI1SEL::Pll1Q),
1 => Some(SPI1SEL::Pll2P),
2 => Some(SPI1SEL::Pll3P),
3 => Some(SPI1SEL::I2sCkin),
4 => Some(SPI1SEL::Per),
_ => None,
}
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == SPI1SEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == SPI1SEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_p(&self) -> bool {
*self == SPI1SEL::Pll3P
}
#[inline(always)]
pub fn is_i2s_ckin(&self) -> bool {
*self == SPI1SEL::I2sCkin
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == SPI1SEL::Per
}
}
pub type SPI1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SPI1SEL>;
impl<'a, REG> SPI1SEL_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(SPI1SEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(SPI1SEL::Pll2P)
}
#[inline(always)]
pub fn pll3_p(self) -> &'a mut crate::W<REG> {
self.variant(SPI1SEL::Pll3P)
}
#[inline(always)]
pub fn i2s_ckin(self) -> &'a mut crate::W<REG> {
self.variant(SPI1SEL::I2sCkin)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(SPI1SEL::Per)
}
}
#[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 SAI2SEL {
Pll1Q = 0,
Pll2P = 1,
Pll3P = 2,
I2sCkin = 3,
Per = 4,
SpdifrxSymb = 5,
}
impl From<SAI2SEL> for u8 {
#[inline(always)]
fn from(variant: SAI2SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SAI2SEL {
type Ux = u8;
}
impl crate::IsEnum for SAI2SEL {}
pub type SAI2SEL_R = crate::FieldReader<SAI2SEL>;
impl SAI2SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SAI2SEL> {
match self.bits {
0 => Some(SAI2SEL::Pll1Q),
1 => Some(SAI2SEL::Pll2P),
2 => Some(SAI2SEL::Pll3P),
3 => Some(SAI2SEL::I2sCkin),
4 => Some(SAI2SEL::Per),
5 => Some(SAI2SEL::SpdifrxSymb),
_ => None,
}
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == SAI2SEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == SAI2SEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_p(&self) -> bool {
*self == SAI2SEL::Pll3P
}
#[inline(always)]
pub fn is_i2s_ckin(&self) -> bool {
*self == SAI2SEL::I2sCkin
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == SAI2SEL::Per
}
#[inline(always)]
pub fn is_spdifrx_symb(&self) -> bool {
*self == SAI2SEL::SpdifrxSymb
}
}
pub type SAI2SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SAI2SEL>;
impl<'a, REG> SAI2SEL_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(SAI2SEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(SAI2SEL::Pll2P)
}
#[inline(always)]
pub fn pll3_p(self) -> &'a mut crate::W<REG> {
self.variant(SAI2SEL::Pll3P)
}
#[inline(always)]
pub fn i2s_ckin(self) -> &'a mut crate::W<REG> {
self.variant(SAI2SEL::I2sCkin)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(SAI2SEL::Per)
}
#[inline(always)]
pub fn spdifrx_symb(self) -> &'a mut crate::W<REG> {
self.variant(SAI2SEL::SpdifrxSymb)
}
}
impl R {
#[inline(always)]
pub fn usart1sel(&self) -> USART1SEL_R {
USART1SEL_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn spi45sel(&self) -> SPI45SEL_R {
SPI45SEL_R::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn spi1sel(&self) -> SPI1SEL_R {
SPI1SEL_R::new(((self.bits >> 8) & 7) as u8)
}
#[inline(always)]
pub fn sai1sel(&self) -> SAI1SEL_R {
SAI1SEL_R::new(((self.bits >> 16) & 7) as u8)
}
#[inline(always)]
pub fn sai2sel(&self) -> SAI2SEL_R {
SAI2SEL_R::new(((self.bits >> 20) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCIPR3")
.field("usart1sel", &self.usart1sel())
.field("spi45sel", &self.spi45sel())
.field("spi1sel", &self.spi1sel())
.field("sai1sel", &self.sai1sel())
.field("sai2sel", &self.sai2sel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn usart1sel(&mut self) -> USART1SEL_W<CCIPR3rs> {
USART1SEL_W::new(self, 0)
}
#[inline(always)]
pub fn spi45sel(&mut self) -> SPI45SEL_W<CCIPR3rs> {
SPI45SEL_W::new(self, 4)
}
#[inline(always)]
pub fn spi1sel(&mut self) -> SPI1SEL_W<CCIPR3rs> {
SPI1SEL_W::new(self, 8)
}
#[inline(always)]
pub fn sai1sel(&mut self) -> SAI1SEL_W<CCIPR3rs> {
SAI1SEL_W::new(self, 16)
}
#[inline(always)]
pub fn sai2sel(&mut self) -> SAI2SEL_W<CCIPR3rs> {
SAI2SEL_W::new(self, 20)
}
}
pub struct CCIPR3rs;
impl crate::RegisterSpec for CCIPR3rs {
type Ux = u32;
}
impl crate::Readable for CCIPR3rs {}
impl crate::Writable for CCIPR3rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCIPR3rs {}