pub type R = crate::R<CCIPRrs>;
pub type W = crate::W<CCIPRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum USART1SEL {
Apb = 0,
System = 1,
Hsi16 = 2,
Lse = 3,
}
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) -> USART1SEL {
match self.bits {
0 => USART1SEL::Apb,
1 => USART1SEL::System,
2 => USART1SEL::Hsi16,
3 => USART1SEL::Lse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_apb(&self) -> bool {
*self == USART1SEL::Apb
}
#[inline(always)]
pub fn is_system(&self) -> bool {
*self == USART1SEL::System
}
#[inline(always)]
pub fn is_hsi16(&self) -> bool {
*self == USART1SEL::Hsi16
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == USART1SEL::Lse
}
}
pub type USART1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, USART1SEL, crate::Safe>;
impl<'a, REG> USART1SEL_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(USART1SEL::Apb)
}
#[inline(always)]
pub fn system(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::System)
}
#[inline(always)]
pub fn hsi16(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Hsi16)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Lse)
}
}
pub use USART1SEL_R as USART2SEL_R;
pub use USART1SEL_R as LPUART1SEL_R;
pub use USART1SEL_W as USART2SEL_W;
pub use USART1SEL_W as LPUART1SEL_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2C1SEL {
Apb = 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::Apb),
1 => Some(I2C1SEL::System),
2 => Some(I2C1SEL::Hsi16),
_ => None,
}
}
#[inline(always)]
pub fn is_apb(&self) -> bool {
*self == I2C1SEL::Apb
}
#[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 apb(self) -> &'a mut crate::W<REG> {
self.variant(I2C1SEL::Apb)
}
#[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 I2C3SEL_R;
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 {
Apb = 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::Apb,
1 => LPTIM1SEL::Lsi,
2 => LPTIM1SEL::Hsi16,
3 => LPTIM1SEL::Lse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_apb(&self) -> bool {
*self == LPTIM1SEL::Apb
}
#[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 apb(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM1SEL::Apb)
}
#[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)
}
}
pub type HSI48MSEL_R = crate::BitReader;
pub type HSI48MSEL_W<'a, REG> = crate::BitWriter<'a, REG>;
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 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 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 hsi48msel(&self) -> HSI48MSEL_R {
HSI48MSEL_R::new(((self.bits >> 26) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCIPR")
.field("hsi48msel", &self.hsi48msel())
.field("lptim1sel", &self.lptim1sel())
.field("i2c1sel", &self.i2c1sel())
.field("usart1sel", &self.usart1sel())
.field("lpuart1sel", &self.lpuart1sel())
.field("usart2sel", &self.usart2sel())
.field("i2c3sel", &self.i2c3sel())
.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 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 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 hsi48msel(&mut self) -> HSI48MSEL_W<CCIPRrs> {
HSI48MSEL_W::new(self, 26)
}
}
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 {}