pub type R = crate::R<D2CCIP2Rrs>;
pub type W = crate::W<D2CCIP2Rrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum USART234578SEL {
RccPclk1 = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
Lse = 5,
}
impl From<USART234578SEL> for u8 {
#[inline(always)]
fn from(variant: USART234578SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for USART234578SEL {
type Ux = u8;
}
impl crate::IsEnum for USART234578SEL {}
pub type USART234578SEL_R = crate::FieldReader<USART234578SEL>;
impl USART234578SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<USART234578SEL> {
match self.bits {
0 => Some(USART234578SEL::RccPclk1),
1 => Some(USART234578SEL::Pll2Q),
2 => Some(USART234578SEL::Pll3Q),
3 => Some(USART234578SEL::HsiKer),
4 => Some(USART234578SEL::CsiKer),
5 => Some(USART234578SEL::Lse),
_ => None,
}
}
#[inline(always)]
pub fn is_rcc_pclk1(&self) -> bool {
*self == USART234578SEL::RccPclk1
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == USART234578SEL::Pll2Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == USART234578SEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == USART234578SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == USART234578SEL::CsiKer
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == USART234578SEL::Lse
}
}
pub type USART234578SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, USART234578SEL>;
impl<'a, REG> USART234578SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn rcc_pclk1(self) -> &'a mut crate::W<REG> {
self.variant(USART234578SEL::RccPclk1)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(USART234578SEL::Pll2Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(USART234578SEL::Pll3Q)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(USART234578SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(USART234578SEL::CsiKer)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(USART234578SEL::Lse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum USART16SEL {
RccPclk2 = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
Lse = 5,
}
impl From<USART16SEL> for u8 {
#[inline(always)]
fn from(variant: USART16SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for USART16SEL {
type Ux = u8;
}
impl crate::IsEnum for USART16SEL {}
pub type USART16SEL_R = crate::FieldReader<USART16SEL>;
impl USART16SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<USART16SEL> {
match self.bits {
0 => Some(USART16SEL::RccPclk2),
1 => Some(USART16SEL::Pll2Q),
2 => Some(USART16SEL::Pll3Q),
3 => Some(USART16SEL::HsiKer),
4 => Some(USART16SEL::CsiKer),
5 => Some(USART16SEL::Lse),
_ => None,
}
}
#[inline(always)]
pub fn is_rcc_pclk2(&self) -> bool {
*self == USART16SEL::RccPclk2
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == USART16SEL::Pll2Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == USART16SEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == USART16SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == USART16SEL::CsiKer
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == USART16SEL::Lse
}
}
pub type USART16SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, USART16SEL>;
impl<'a, REG> USART16SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn rcc_pclk2(self) -> &'a mut crate::W<REG> {
self.variant(USART16SEL::RccPclk2)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(USART16SEL::Pll2Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(USART16SEL::Pll3Q)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(USART16SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(USART16SEL::CsiKer)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(USART16SEL::Lse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RNGSEL {
Hsi48 = 0,
Pll1Q = 1,
Lse = 2,
Lsi = 3,
}
impl From<RNGSEL> for u8 {
#[inline(always)]
fn from(variant: RNGSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for RNGSEL {
type Ux = u8;
}
impl crate::IsEnum for RNGSEL {}
pub type RNGSEL_R = crate::FieldReader<RNGSEL>;
impl RNGSEL_R {
#[inline(always)]
pub const fn variant(&self) -> RNGSEL {
match self.bits {
0 => RNGSEL::Hsi48,
1 => RNGSEL::Pll1Q,
2 => RNGSEL::Lse,
3 => RNGSEL::Lsi,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_hsi48(&self) -> bool {
*self == RNGSEL::Hsi48
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == RNGSEL::Pll1Q
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == RNGSEL::Lse
}
#[inline(always)]
pub fn is_lsi(&self) -> bool {
*self == RNGSEL::Lsi
}
}
pub type RNGSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, RNGSEL, crate::Safe>;
impl<'a, REG> RNGSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn hsi48(self) -> &'a mut crate::W<REG> {
self.variant(RNGSEL::Hsi48)
}
#[inline(always)]
pub fn pll1_q(self) -> &'a mut crate::W<REG> {
self.variant(RNGSEL::Pll1Q)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(RNGSEL::Lse)
}
#[inline(always)]
pub fn lsi(self) -> &'a mut crate::W<REG> {
self.variant(RNGSEL::Lsi)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2C123SEL {
RccPclk1 = 0,
Pll3R = 1,
HsiKer = 2,
CsiKer = 3,
}
impl From<I2C123SEL> for u8 {
#[inline(always)]
fn from(variant: I2C123SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for I2C123SEL {
type Ux = u8;
}
impl crate::IsEnum for I2C123SEL {}
pub type I2C123SEL_R = crate::FieldReader<I2C123SEL>;
impl I2C123SEL_R {
#[inline(always)]
pub const fn variant(&self) -> I2C123SEL {
match self.bits {
0 => I2C123SEL::RccPclk1,
1 => I2C123SEL::Pll3R,
2 => I2C123SEL::HsiKer,
3 => I2C123SEL::CsiKer,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_rcc_pclk1(&self) -> bool {
*self == I2C123SEL::RccPclk1
}
#[inline(always)]
pub fn is_pll3_r(&self) -> bool {
*self == I2C123SEL::Pll3R
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == I2C123SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == I2C123SEL::CsiKer
}
}
pub type I2C123SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2C123SEL, crate::Safe>;
impl<'a, REG> I2C123SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn rcc_pclk1(self) -> &'a mut crate::W<REG> {
self.variant(I2C123SEL::RccPclk1)
}
#[inline(always)]
pub fn pll3_r(self) -> &'a mut crate::W<REG> {
self.variant(I2C123SEL::Pll3R)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(I2C123SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(I2C123SEL::CsiKer)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum USBSEL {
Disable = 0,
Pll1Q = 1,
Pll3Q = 2,
Hsi48 = 3,
}
impl From<USBSEL> for u8 {
#[inline(always)]
fn from(variant: USBSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for USBSEL {
type Ux = u8;
}
impl crate::IsEnum for USBSEL {}
pub type USBSEL_R = crate::FieldReader<USBSEL>;
impl USBSEL_R {
#[inline(always)]
pub const fn variant(&self) -> USBSEL {
match self.bits {
0 => USBSEL::Disable,
1 => USBSEL::Pll1Q,
2 => USBSEL::Pll3Q,
3 => USBSEL::Hsi48,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disable(&self) -> bool {
*self == USBSEL::Disable
}
#[inline(always)]
pub fn is_pll1_q(&self) -> bool {
*self == USBSEL::Pll1Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == USBSEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi48(&self) -> bool {
*self == USBSEL::Hsi48
}
}
pub type USBSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, USBSEL, crate::Safe>;
impl<'a, REG> USBSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disable(self) -> &'a mut crate::W<REG> {
self.variant(USBSEL::Disable)
}
#[inline(always)]
pub fn pll1_q(self) -> &'a mut crate::W<REG> {
self.variant(USBSEL::Pll1Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(USBSEL::Pll3Q)
}
#[inline(always)]
pub fn hsi48(self) -> &'a mut crate::W<REG> {
self.variant(USBSEL::Hsi48)
}
}
#[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)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPTIM1SEL {
RccPclk1 = 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::RccPclk1),
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_rcc_pclk1(&self) -> bool {
*self == LPTIM1SEL::RccPclk1
}
#[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 rcc_pclk1(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::RccPclk1)
}
#[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)
}
}
impl R {
#[inline(always)]
pub fn usart234578sel(&self) -> USART234578SEL_R {
USART234578SEL_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn usart16sel(&self) -> USART16SEL_R {
USART16SEL_R::new(((self.bits >> 3) & 7) as u8)
}
#[inline(always)]
pub fn rngsel(&self) -> RNGSEL_R {
RNGSEL_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn i2c123sel(&self) -> I2C123SEL_R {
I2C123SEL_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn usbsel(&self) -> USBSEL_R {
USBSEL_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn cecsel(&self) -> CECSEL_R {
CECSEL_R::new(((self.bits >> 22) & 3) as u8)
}
#[inline(always)]
pub fn lptim1sel(&self) -> LPTIM1SEL_R {
LPTIM1SEL_R::new(((self.bits >> 28) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("D2CCIP2R")
.field("usart234578sel", &self.usart234578sel())
.field("usart16sel", &self.usart16sel())
.field("rngsel", &self.rngsel())
.field("i2c123sel", &self.i2c123sel())
.field("usbsel", &self.usbsel())
.field("cecsel", &self.cecsel())
.field("lptim1sel", &self.lptim1sel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn usart234578sel(&mut self) -> USART234578SEL_W<D2CCIP2Rrs> {
USART234578SEL_W::new(self, 0)
}
#[inline(always)]
pub fn usart16sel(&mut self) -> USART16SEL_W<D2CCIP2Rrs> {
USART16SEL_W::new(self, 3)
}
#[inline(always)]
pub fn rngsel(&mut self) -> RNGSEL_W<D2CCIP2Rrs> {
RNGSEL_W::new(self, 8)
}
#[inline(always)]
pub fn i2c123sel(&mut self) -> I2C123SEL_W<D2CCIP2Rrs> {
I2C123SEL_W::new(self, 12)
}
#[inline(always)]
pub fn usbsel(&mut self) -> USBSEL_W<D2CCIP2Rrs> {
USBSEL_W::new(self, 20)
}
#[inline(always)]
pub fn cecsel(&mut self) -> CECSEL_W<D2CCIP2Rrs> {
CECSEL_W::new(self, 22)
}
#[inline(always)]
pub fn lptim1sel(&mut self) -> LPTIM1SEL_W<D2CCIP2Rrs> {
LPTIM1SEL_W::new(self, 28)
}
}
pub struct D2CCIP2Rrs;
impl crate::RegisterSpec for D2CCIP2Rrs {
type Ux = u32;
}
impl crate::Readable for D2CCIP2Rrs {}
impl crate::Writable for D2CCIP2Rrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for D2CCIP2Rrs {}