pub type R = crate::R<CCIPRrs>;
pub type W = crate::W<CCIPRrs>;
pub type USART1SEL_R = crate::FieldReader;
pub type USART1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type USART2SEL_R = crate::FieldReader;
pub type USART2SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type USART3SEL_R = crate::FieldReader;
pub type USART3SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum UART4SEL {
Pclk = 0,
System = 1,
Hsi16 = 2,
Lse = 3,
}
impl From<UART4SEL> for u8 {
#[inline(always)]
fn from(variant: UART4SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for UART4SEL {
type Ux = u8;
}
impl crate::IsEnum for UART4SEL {}
pub type UART4SEL_R = crate::FieldReader<UART4SEL>;
impl UART4SEL_R {
#[inline(always)]
pub const fn variant(&self) -> UART4SEL {
match self.bits {
0 => UART4SEL::Pclk,
1 => UART4SEL::System,
2 => UART4SEL::Hsi16,
3 => UART4SEL::Lse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == UART4SEL::Pclk
}
#[inline(always)]
pub fn is_system(&self) -> bool {
*self == UART4SEL::System
}
#[inline(always)]
pub fn is_hsi16(&self) -> bool {
*self == UART4SEL::Hsi16
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == UART4SEL::Lse
}
}
pub type UART4SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, UART4SEL, crate::Safe>;
impl<'a, REG> UART4SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk(self) -> &'a mut crate::W<REG> {
self.variant(UART4SEL::Pclk)
}
#[inline(always)]
pub fn system(self) -> &'a mut crate::W<REG> {
self.variant(UART4SEL::System)
}
#[inline(always)]
pub fn hsi16(self) -> &'a mut crate::W<REG> {
self.variant(UART4SEL::Hsi16)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(UART4SEL::Lse)
}
}
pub use UART4SEL_R as UART5SEL_R;
pub use UART4SEL_R as LPUART1SEL_R;
pub use UART4SEL_W as UART5SEL_W;
pub use UART4SEL_W as LPUART1SEL_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2C1SEL {
Pclk = 0,
System = 1,
Hsi16 = 2,
}
impl From<I2C1SEL> for u8 {
#[inline(always)]
fn from(variant: I2C1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for I2C1SEL {
type Ux = u8;
}
impl crate::IsEnum for I2C1SEL {}
pub type I2C1SEL_R = crate::FieldReader<I2C1SEL>;
impl I2C1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<I2C1SEL> {
match self.bits {
0 => Some(I2C1SEL::Pclk),
1 => Some(I2C1SEL::System),
2 => Some(I2C1SEL::Hsi16),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == I2C1SEL::Pclk
}
#[inline(always)]
pub fn is_system(&self) -> bool {
*self == I2C1SEL::System
}
#[inline(always)]
pub fn is_hsi16(&self) -> bool {
*self == I2C1SEL::Hsi16
}
}
pub type I2C1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2C1SEL>;
impl<'a, REG> I2C1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk(self) -> &'a mut crate::W<REG> {
self.variant(I2C1SEL::Pclk)
}
#[inline(always)]
pub fn system(self) -> &'a mut crate::W<REG> {
self.variant(I2C1SEL::System)
}
#[inline(always)]
pub fn hsi16(self) -> &'a mut crate::W<REG> {
self.variant(I2C1SEL::Hsi16)
}
}
pub use I2C1SEL_R as I2C2SEL_R;
pub use I2C1SEL_R as I2C3SEL_R;
pub use I2C1SEL_W as I2C2SEL_W;
pub use I2C1SEL_W as I2C3SEL_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPTIM1SEL {
Pclk = 0,
Lsi = 1,
Hsi16 = 2,
Lse = 3,
}
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) -> LPTIM1SEL {
match self.bits {
0 => LPTIM1SEL::Pclk,
1 => LPTIM1SEL::Lsi,
2 => LPTIM1SEL::Hsi16,
3 => LPTIM1SEL::Lse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == LPTIM1SEL::Pclk
}
#[inline(always)]
pub fn is_lsi(&self) -> bool {
*self == LPTIM1SEL::Lsi
}
#[inline(always)]
pub fn is_hsi16(&self) -> bool {
*self == LPTIM1SEL::Hsi16
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == LPTIM1SEL::Lse
}
}
pub type LPTIM1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LPTIM1SEL, crate::Safe>;
impl<'a, REG> LPTIM1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Pclk)
}
#[inline(always)]
pub fn lsi(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Lsi)
}
#[inline(always)]
pub fn hsi16(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Hsi16)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Lse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SAI1SEL {
System = 0,
Pllq = 1,
I2sCkin = 2,
Hsi16 = 3,
}
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) -> SAI1SEL {
match self.bits {
0 => SAI1SEL::System,
1 => SAI1SEL::Pllq,
2 => SAI1SEL::I2sCkin,
3 => SAI1SEL::Hsi16,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_system(&self) -> bool {
*self == SAI1SEL::System
}
#[inline(always)]
pub fn is_pllq(&self) -> bool {
*self == SAI1SEL::Pllq
}
#[inline(always)]
pub fn is_i2s_ckin(&self) -> bool {
*self == SAI1SEL::I2sCkin
}
#[inline(always)]
pub fn is_hsi16(&self) -> bool {
*self == SAI1SEL::Hsi16
}
}
pub type SAI1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SAI1SEL, crate::Safe>;
impl<'a, REG> SAI1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn system(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::System)
}
#[inline(always)]
pub fn pllq(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::Pllq)
}
#[inline(always)]
pub fn i2s_ckin(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::I2sCkin)
}
#[inline(always)]
pub fn hsi16(self) -> &'a mut crate::W<REG> {
self.variant(SAI1SEL::Hsi16)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2S23SEL {
System = 0,
Pllq = 1,
I2sCkin = 2,
Hsi16 = 3,
}
impl From<I2S23SEL> for u8 {
#[inline(always)]
fn from(variant: I2S23SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for I2S23SEL {
type Ux = u8;
}
impl crate::IsEnum for I2S23SEL {}
pub type I2S23SEL_R = crate::FieldReader<I2S23SEL>;
impl I2S23SEL_R {
#[inline(always)]
pub const fn variant(&self) -> I2S23SEL {
match self.bits {
0 => I2S23SEL::System,
1 => I2S23SEL::Pllq,
2 => I2S23SEL::I2sCkin,
3 => I2S23SEL::Hsi16,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_system(&self) -> bool {
*self == I2S23SEL::System
}
#[inline(always)]
pub fn is_pllq(&self) -> bool {
*self == I2S23SEL::Pllq
}
#[inline(always)]
pub fn is_i2s_ckin(&self) -> bool {
*self == I2S23SEL::I2sCkin
}
#[inline(always)]
pub fn is_hsi16(&self) -> bool {
*self == I2S23SEL::Hsi16
}
}
pub type I2S23SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2S23SEL, crate::Safe>;
impl<'a, REG> I2S23SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn system(self) -> &'a mut crate::W<REG> {
self.variant(I2S23SEL::System)
}
#[inline(always)]
pub fn pllq(self) -> &'a mut crate::W<REG> {
self.variant(I2S23SEL::Pllq)
}
#[inline(always)]
pub fn i2s_ckin(self) -> &'a mut crate::W<REG> {
self.variant(I2S23SEL::I2sCkin)
}
#[inline(always)]
pub fn hsi16(self) -> &'a mut crate::W<REG> {
self.variant(I2S23SEL::Hsi16)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FDCANSEL {
Hse = 0,
Pllq = 1,
Pclk = 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::Pllq),
2 => Some(FDCANSEL::Pclk),
_ => None,
}
}
#[inline(always)]
pub fn is_hse(&self) -> bool {
*self == FDCANSEL::Hse
}
#[inline(always)]
pub fn is_pllq(&self) -> bool {
*self == FDCANSEL::Pllq
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == FDCANSEL::Pclk
}
}
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 pllq(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::Pllq)
}
#[inline(always)]
pub fn pclk(self) -> &'a mut crate::W<REG> {
self.variant(FDCANSEL::Pclk)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CLK48SEL {
Hsi48 = 0,
Pllq = 2,
}
impl From<CLK48SEL> for u8 {
#[inline(always)]
fn from(variant: CLK48SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for CLK48SEL {
type Ux = u8;
}
impl crate::IsEnum for CLK48SEL {}
pub type CLK48SEL_R = crate::FieldReader<CLK48SEL>;
impl CLK48SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CLK48SEL> {
match self.bits {
0 => Some(CLK48SEL::Hsi48),
2 => Some(CLK48SEL::Pllq),
_ => None,
}
}
#[inline(always)]
pub fn is_hsi48(&self) -> bool {
*self == CLK48SEL::Hsi48
}
#[inline(always)]
pub fn is_pllq(&self) -> bool {
*self == CLK48SEL::Pllq
}
}
pub type CLK48SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CLK48SEL>;
impl<'a, REG> CLK48SEL_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(CLK48SEL::Hsi48)
}
#[inline(always)]
pub fn pllq(self) -> &'a mut crate::W<REG> {
self.variant(CLK48SEL::Pllq)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ADC12SEL {
None = 0,
Pllp = 1,
System = 2,
}
impl From<ADC12SEL> for u8 {
#[inline(always)]
fn from(variant: ADC12SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for ADC12SEL {
type Ux = u8;
}
impl crate::IsEnum for ADC12SEL {}
pub type ADC12SEL_R = crate::FieldReader<ADC12SEL>;
impl ADC12SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<ADC12SEL> {
match self.bits {
0 => Some(ADC12SEL::None),
1 => Some(ADC12SEL::Pllp),
2 => Some(ADC12SEL::System),
_ => None,
}
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == ADC12SEL::None
}
#[inline(always)]
pub fn is_pllp(&self) -> bool {
*self == ADC12SEL::Pllp
}
#[inline(always)]
pub fn is_system(&self) -> bool {
*self == ADC12SEL::System
}
}
pub type ADC12SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ADC12SEL>;
impl<'a, REG> ADC12SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(ADC12SEL::None)
}
#[inline(always)]
pub fn pllp(self) -> &'a mut crate::W<REG> {
self.variant(ADC12SEL::Pllp)
}
#[inline(always)]
pub fn system(self) -> &'a mut crate::W<REG> {
self.variant(ADC12SEL::System)
}
}
pub use ADC12SEL_R as ADC345SEL_R;
pub use ADC12SEL_W as ADC345SEL_W;
impl R {
#[inline(always)]
pub fn usart1sel(&self) -> USART1SEL_R {
USART1SEL_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn usart2sel(&self) -> USART2SEL_R {
USART2SEL_R::new(((self.bits >> 2) & 3) as u8)
}
#[inline(always)]
pub fn usart3sel(&self) -> USART3SEL_R {
USART3SEL_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn uart4sel(&self) -> UART4SEL_R {
UART4SEL_R::new(((self.bits >> 6) & 3) as u8)
}
#[inline(always)]
pub fn uart5sel(&self) -> UART5SEL_R {
UART5SEL_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn lpuart1sel(&self) -> LPUART1SEL_R {
LPUART1SEL_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn i2c1sel(&self) -> I2C1SEL_R {
I2C1SEL_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn i2c2sel(&self) -> I2C2SEL_R {
I2C2SEL_R::new(((self.bits >> 14) & 3) as u8)
}
#[inline(always)]
pub fn i2c3sel(&self) -> I2C3SEL_R {
I2C3SEL_R::new(((self.bits >> 16) & 3) as u8)
}
#[inline(always)]
pub fn lptim1sel(&self) -> LPTIM1SEL_R {
LPTIM1SEL_R::new(((self.bits >> 18) & 3) as u8)
}
#[inline(always)]
pub fn sai1sel(&self) -> SAI1SEL_R {
SAI1SEL_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn i2s23sel(&self) -> I2S23SEL_R {
I2S23SEL_R::new(((self.bits >> 22) & 3) as u8)
}
#[inline(always)]
pub fn fdcansel(&self) -> FDCANSEL_R {
FDCANSEL_R::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn clk48sel(&self) -> CLK48SEL_R {
CLK48SEL_R::new(((self.bits >> 26) & 3) as u8)
}
#[inline(always)]
pub fn adc12sel(&self) -> ADC12SEL_R {
ADC12SEL_R::new(((self.bits >> 28) & 3) as u8)
}
#[inline(always)]
pub fn adc345sel(&self) -> ADC345SEL_R {
ADC345SEL_R::new(((self.bits >> 30) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCIPR")
.field("usart1sel", &self.usart1sel())
.field("usart2sel", &self.usart2sel())
.field("usart3sel", &self.usart3sel())
.field("uart4sel", &self.uart4sel())
.field("uart5sel", &self.uart5sel())
.field("lpuart1sel", &self.lpuart1sel())
.field("i2c1sel", &self.i2c1sel())
.field("i2c2sel", &self.i2c2sel())
.field("i2c3sel", &self.i2c3sel())
.field("lptim1sel", &self.lptim1sel())
.field("sai1sel", &self.sai1sel())
.field("i2s23sel", &self.i2s23sel())
.field("fdcansel", &self.fdcansel())
.field("clk48sel", &self.clk48sel())
.field("adc12sel", &self.adc12sel())
.field("adc345sel", &self.adc345sel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn usart1sel(&mut self) -> USART1SEL_W<CCIPRrs> {
USART1SEL_W::new(self, 0)
}
#[inline(always)]
pub fn usart2sel(&mut self) -> USART2SEL_W<CCIPRrs> {
USART2SEL_W::new(self, 2)
}
#[inline(always)]
pub fn usart3sel(&mut self) -> USART3SEL_W<CCIPRrs> {
USART3SEL_W::new(self, 4)
}
#[inline(always)]
pub fn uart4sel(&mut self) -> UART4SEL_W<CCIPRrs> {
UART4SEL_W::new(self, 6)
}
#[inline(always)]
pub fn uart5sel(&mut self) -> UART5SEL_W<CCIPRrs> {
UART5SEL_W::new(self, 8)
}
#[inline(always)]
pub fn lpuart1sel(&mut self) -> LPUART1SEL_W<CCIPRrs> {
LPUART1SEL_W::new(self, 10)
}
#[inline(always)]
pub fn i2c1sel(&mut self) -> I2C1SEL_W<CCIPRrs> {
I2C1SEL_W::new(self, 12)
}
#[inline(always)]
pub fn i2c2sel(&mut self) -> I2C2SEL_W<CCIPRrs> {
I2C2SEL_W::new(self, 14)
}
#[inline(always)]
pub fn i2c3sel(&mut self) -> I2C3SEL_W<CCIPRrs> {
I2C3SEL_W::new(self, 16)
}
#[inline(always)]
pub fn lptim1sel(&mut self) -> LPTIM1SEL_W<CCIPRrs> {
LPTIM1SEL_W::new(self, 18)
}
#[inline(always)]
pub fn sai1sel(&mut self) -> SAI1SEL_W<CCIPRrs> {
SAI1SEL_W::new(self, 20)
}
#[inline(always)]
pub fn i2s23sel(&mut self) -> I2S23SEL_W<CCIPRrs> {
I2S23SEL_W::new(self, 22)
}
#[inline(always)]
pub fn fdcansel(&mut self) -> FDCANSEL_W<CCIPRrs> {
FDCANSEL_W::new(self, 24)
}
#[inline(always)]
pub fn clk48sel(&mut self) -> CLK48SEL_W<CCIPRrs> {
CLK48SEL_W::new(self, 26)
}
#[inline(always)]
pub fn adc12sel(&mut self) -> ADC12SEL_W<CCIPRrs> {
ADC12SEL_W::new(self, 28)
}
#[inline(always)]
pub fn adc345sel(&mut self) -> ADC345SEL_W<CCIPRrs> {
ADC345SEL_W::new(self, 30)
}
}
pub struct CCIPRrs;
impl crate::RegisterSpec for CCIPRrs {
type Ux = u32;
}
impl crate::Readable for CCIPRrs {}
impl crate::Writable for CCIPRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCIPRrs {}