pub type R = crate::R<CCIPR2rs>;
pub type W = crate::W<CCIPR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum UART234578SEL {
Pclk1 = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
Lse = 5,
}
impl From<UART234578SEL> for u8 {
#[inline(always)]
fn from(variant: UART234578SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for UART234578SEL {
type Ux = u8;
}
impl crate::IsEnum for UART234578SEL {}
pub type UART234578SEL_R = crate::FieldReader<UART234578SEL>;
impl UART234578SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<UART234578SEL> {
match self.bits {
0 => Some(UART234578SEL::Pclk1),
1 => Some(UART234578SEL::Pll2Q),
2 => Some(UART234578SEL::Pll3Q),
3 => Some(UART234578SEL::HsiKer),
4 => Some(UART234578SEL::CsiKer),
5 => Some(UART234578SEL::Lse),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk1(&self) -> bool {
*self == UART234578SEL::Pclk1
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == UART234578SEL::Pll2Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == UART234578SEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == UART234578SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == UART234578SEL::CsiKer
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == UART234578SEL::Lse
}
}
pub type UART234578SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, UART234578SEL>;
impl<'a, REG> UART234578SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk1(self) -> &'a mut crate::W<REG> {
self.variant(UART234578SEL::Pclk1)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(UART234578SEL::Pll2Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(UART234578SEL::Pll3Q)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(UART234578SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(UART234578SEL::CsiKer)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(UART234578SEL::Lse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SPI23SEL {
Pll1Q = 0,
Pll2P = 1,
Pll3P = 2,
I2sCkin = 3,
Per = 4,
}
impl From<SPI23SEL> for u8 {
#[inline(always)]
fn from(variant: SPI23SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SPI23SEL {
type Ux = u8;
}
impl crate::IsEnum for SPI23SEL {}
pub type SPI23SEL_R = crate::FieldReader<SPI23SEL>;
impl SPI23SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SPI23SEL> {
match self.bits {
0 => Some(SPI23SEL::Pll1Q),
1 => Some(SPI23SEL::Pll2P),
2 => Some(SPI23SEL::Pll3P),
3 => Some(SPI23SEL::I2sCkin),
4 => Some(SPI23SEL::Per),
_ => None,
}
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == SPI23SEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == SPI23SEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_p(&self) -> bool {
*self == SPI23SEL::Pll3P
}
#[inline(always)]
pub fn is_i2s_ckin(&self) -> bool {
*self == SPI23SEL::I2sCkin
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == SPI23SEL::Per
}
}
pub type SPI23SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SPI23SEL>;
impl<'a, REG> SPI23SEL_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(SPI23SEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(SPI23SEL::Pll2P)
}
#[inline(always)]
pub fn pll3_p(self) -> &'a mut crate::W<REG> {
self.variant(SPI23SEL::Pll3P)
}
#[inline(always)]
pub fn i2s_ckin(self) -> &'a mut crate::W<REG> {
self.variant(SPI23SEL::I2sCkin)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(SPI23SEL::Per)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2C23SEL {
Pclk1 = 0,
Pll3R = 1,
HsiKer = 2,
CsiKer = 3,
}
impl From<I2C23SEL> for u8 {
#[inline(always)]
fn from(variant: I2C23SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for I2C23SEL {
type Ux = u8;
}
impl crate::IsEnum for I2C23SEL {}
pub type I2C23SEL_R = crate::FieldReader<I2C23SEL>;
impl I2C23SEL_R {
#[inline(always)]
pub const fn variant(&self) -> I2C23SEL {
match self.bits {
0 => I2C23SEL::Pclk1,
1 => I2C23SEL::Pll3R,
2 => I2C23SEL::HsiKer,
3 => I2C23SEL::CsiKer,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_pclk1(&self) -> bool {
*self == I2C23SEL::Pclk1
}
#[inline(always)]
pub fn is_pll3_r(&self) -> bool {
*self == I2C23SEL::Pll3R
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == I2C23SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == I2C23SEL::CsiKer
}
}
pub type I2C23SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2C23SEL, crate::Safe>;
impl<'a, REG> I2C23SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk1(self) -> &'a mut crate::W<REG> {
self.variant(I2C23SEL::Pclk1)
}
#[inline(always)]
pub fn pll3_r(self) -> &'a mut crate::W<REG> {
self.variant(I2C23SEL::Pll3R)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(I2C23SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(I2C23SEL::CsiKer)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2C1I3C1SEL {
Pclk1 = 0,
Pll3R = 1,
HsiKer = 2,
CsiKer = 3,
}
impl From<I2C1I3C1SEL> for u8 {
#[inline(always)]
fn from(variant: I2C1I3C1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for I2C1I3C1SEL {
type Ux = u8;
}
impl crate::IsEnum for I2C1I3C1SEL {}
pub type I2C1I3C1SEL_R = crate::FieldReader<I2C1I3C1SEL>;
impl I2C1I3C1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> I2C1I3C1SEL {
match self.bits {
0 => I2C1I3C1SEL::Pclk1,
1 => I2C1I3C1SEL::Pll3R,
2 => I2C1I3C1SEL::HsiKer,
3 => I2C1I3C1SEL::CsiKer,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_pclk1(&self) -> bool {
*self == I2C1I3C1SEL::Pclk1
}
#[inline(always)]
pub fn is_pll3_r(&self) -> bool {
*self == I2C1I3C1SEL::Pll3R
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == I2C1I3C1SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == I2C1I3C1SEL::CsiKer
}
}
pub type I2C1I3C1SEL_W<'a, REG> = crate::FieldWriter<
'a,
REG,
2,
I2C1I3C1SEL,
crate::Safe,
>;
impl<'a, REG> I2C1I3C1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk1(self) -> &'a mut crate::W<REG> {
self.variant(I2C1I3C1SEL::Pclk1)
}
#[inline(always)]
pub fn pll3_r(self) -> &'a mut crate::W<REG> {
self.variant(I2C1I3C1SEL::Pll3R)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(I2C1I3C1SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(I2C1I3C1SEL::CsiKer)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPTIM1SEL {
Pclk1 = 0,
Pll2P = 1,
Pll3R = 2,
Lse = 3,
Lsi = 4,
Per = 5,
}
impl From<LPTIM1SEL> for u8 {
#[inline(always)]
fn from(variant: LPTIM1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for LPTIM1SEL {
type Ux = u8;
}
impl crate::IsEnum for LPTIM1SEL {}
pub type LPTIM1SEL_R = crate::FieldReader<LPTIM1SEL>;
impl LPTIM1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<LPTIM1SEL> {
match self.bits {
0 => Some(LPTIM1SEL::Pclk1),
1 => Some(LPTIM1SEL::Pll2P),
2 => Some(LPTIM1SEL::Pll3R),
3 => Some(LPTIM1SEL::Lse),
4 => Some(LPTIM1SEL::Lsi),
5 => Some(LPTIM1SEL::Per),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk1(&self) -> bool {
*self == LPTIM1SEL::Pclk1
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == LPTIM1SEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_r(&self) -> bool {
*self == LPTIM1SEL::Pll3R
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == LPTIM1SEL::Lse
}
#[inline(always)]
pub fn is_lsi(&self) -> bool {
*self == LPTIM1SEL::Lsi
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == LPTIM1SEL::Per
}
}
pub type LPTIM1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, LPTIM1SEL>;
impl<'a, REG> LPTIM1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk1(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Pclk1)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Pll2P)
}
#[inline(always)]
pub fn pll3_r(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Pll3R)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Lse)
}
#[inline(always)]
pub fn lsi(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Lsi)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Per)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FDCANSEL {
HseKer = 0,
Pll1Q = 1,
Pll2P = 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::HseKer),
1 => Some(FDCANSEL::Pll1Q),
2 => Some(FDCANSEL::Pll2P),
_ => None,
}
}
#[inline(always)]
pub fn is_hse_ker(&self) -> bool {
*self == FDCANSEL::HseKer
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == FDCANSEL::Pll1Q
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == FDCANSEL::Pll2P
}
}
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_ker(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::HseKer)
}
#[inline(always)]
pub fn pll1_q(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::Pll1Q)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::Pll2P)
}
}
#[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)]
#[repr(u8)]
pub enum CECSEL {
Lse = 0,
Lsi = 1,
CsiKer = 2,
}
impl From<CECSEL> for u8 {
#[inline(always)]
fn from(variant: CECSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for CECSEL {
type Ux = u8;
}
impl crate::IsEnum for CECSEL {}
pub type CECSEL_R = crate::FieldReader<CECSEL>;
impl CECSEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CECSEL> {
match self.bits {
0 => Some(CECSEL::Lse),
1 => Some(CECSEL::Lsi),
2 => Some(CECSEL::CsiKer),
_ => None,
}
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == CECSEL::Lse
}
#[inline(always)]
pub fn is_lsi(&self) -> bool {
*self == CECSEL::Lsi
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == CECSEL::CsiKer
}
}
pub type CECSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CECSEL>;
impl<'a, REG> CECSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(CECSEL::Lse)
}
#[inline(always)]
pub fn lsi(self) -> &'a mut crate::W<REG> {
self.variant(CECSEL::Lsi)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(CECSEL::CsiKer)
}
}
impl R {
#[inline(always)]
pub fn uart234578sel(&self) -> UART234578SEL_R {
UART234578SEL_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn spi23sel(&self) -> SPI23SEL_R {
SPI23SEL_R::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn i2c23sel(&self) -> I2C23SEL_R {
I2C23SEL_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn i2c1i3c1sel(&self) -> I2C1I3C1SEL_R {
I2C1I3C1SEL_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn lptim1sel(&self) -> LPTIM1SEL_R {
LPTIM1SEL_R::new(((self.bits >> 16) & 7) as u8)
}
#[inline(always)]
pub fn fdcansel(&self) -> FDCANSEL_R {
FDCANSEL_R::new(((self.bits >> 22) & 3) as u8)
}
#[inline(always)]
pub fn spdifrxsel(&self) -> SPDIFRXSEL_R {
SPDIFRXSEL_R::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn cecsel(&self) -> CECSEL_R {
CECSEL_R::new(((self.bits >> 28) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCIPR2")
.field("uart234578sel", &self.uart234578sel())
.field("spi23sel", &self.spi23sel())
.field("i2c23sel", &self.i2c23sel())
.field("i2c1i3c1sel", &self.i2c1i3c1sel())
.field("lptim1sel", &self.lptim1sel())
.field("fdcansel", &self.fdcansel())
.field("spdifrxsel", &self.spdifrxsel())
.field("cecsel", &self.cecsel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn uart234578sel(&mut self) -> UART234578SEL_W<CCIPR2rs> {
UART234578SEL_W::new(self, 0)
}
#[inline(always)]
pub fn spi23sel(&mut self) -> SPI23SEL_W<CCIPR2rs> {
SPI23SEL_W::new(self, 4)
}
#[inline(always)]
pub fn i2c23sel(&mut self) -> I2C23SEL_W<CCIPR2rs> {
I2C23SEL_W::new(self, 8)
}
#[inline(always)]
pub fn i2c1i3c1sel(&mut self) -> I2C1I3C1SEL_W<CCIPR2rs> {
I2C1I3C1SEL_W::new(self, 12)
}
#[inline(always)]
pub fn lptim1sel(&mut self) -> LPTIM1SEL_W<CCIPR2rs> {
LPTIM1SEL_W::new(self, 16)
}
#[inline(always)]
pub fn fdcansel(&mut self) -> FDCANSEL_W<CCIPR2rs> {
FDCANSEL_W::new(self, 22)
}
#[inline(always)]
pub fn spdifrxsel(&mut self) -> SPDIFRXSEL_W<CCIPR2rs> {
SPDIFRXSEL_W::new(self, 24)
}
#[inline(always)]
pub fn cecsel(&mut self) -> CECSEL_W<CCIPR2rs> {
CECSEL_W::new(self, 28)
}
}
pub struct CCIPR2rs;
impl crate::RegisterSpec for CCIPR2rs {
type Ux = u32;
}
impl crate::Readable for CCIPR2rs {}
impl crate::Writable for CCIPR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCIPR2rs {}