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 {
Pclk = 0,
Sysclk = 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::Pclk,
1 => USART1SEL::Sysclk,
2 => USART1SEL::Hsi16,
3 => USART1SEL::Lse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == USART1SEL::Pclk
}
#[inline(always)]
pub fn is_sysclk(&self) -> bool {
*self == USART1SEL::Sysclk
}
#[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 pclk(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Pclk)
}
#[inline(always)]
pub fn sysclk(self) -> &'a mut crate::W<REG> {
self.variant(USART1SEL::Sysclk)
}
#[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 USART3SEL_R;
pub use USART1SEL_R as USART4SEL_R;
pub use USART1SEL_W as USART2SEL_W;
pub use USART1SEL_W as USART3SEL_W;
pub use USART1SEL_W as USART4SEL_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPUART1SEL {
Pclk = 0,
Sysclk = 1,
Hsi16 = 2,
Lse = 3,
}
impl From<LPUART1SEL> for u8 {
#[inline(always)]
fn from(variant: LPUART1SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for LPUART1SEL {
type Ux = u8;
}
impl crate::IsEnum for LPUART1SEL {}
pub type LPUART1SEL_R = crate::FieldReader<LPUART1SEL>;
impl LPUART1SEL_R {
#[inline(always)]
pub const fn variant(&self) -> LPUART1SEL {
match self.bits {
0 => LPUART1SEL::Pclk,
1 => LPUART1SEL::Sysclk,
2 => LPUART1SEL::Hsi16,
3 => LPUART1SEL::Lse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == LPUART1SEL::Pclk
}
#[inline(always)]
pub fn is_sysclk(&self) -> bool {
*self == LPUART1SEL::Sysclk
}
#[inline(always)]
pub fn is_hsi16(&self) -> bool {
*self == LPUART1SEL::Hsi16
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == LPUART1SEL::Lse
}
}
pub type LPUART1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LPUART1SEL, crate::Safe>;
impl<'a, REG> LPUART1SEL_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(LPUART1SEL::Pclk)
}
#[inline(always)]
pub fn sysclk(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::Sysclk)
}
#[inline(always)]
pub fn hsi16(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::Hsi16)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::Lse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2C1SEL {
Pclk = 0,
Sysclk = 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::Sysclk),
2 => Some(I2C1SEL::Hsi16),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk(&self) -> bool {
*self == I2C1SEL::Pclk
}
#[inline(always)]
pub fn is_sysclk(&self) -> bool {
*self == I2C1SEL::Sysclk
}
#[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 sysclk(self) -> &'a mut crate::W<REG> {
self.variant(I2C1SEL::Sysclk)
}
#[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)
}
}
pub use LPTIM1SEL_R as LPTIM2SEL_R;
pub use LPTIM1SEL_W as LPTIM2SEL_W;
pub type SAI1SEL_R = crate::FieldReader;
pub type SAI1SEL_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 CLK48SEL {
Hsi48 = 0,
Pllsai1 = 1,
Pll = 2,
Msi = 3,
}
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) -> CLK48SEL {
match self.bits {
0 => CLK48SEL::Hsi48,
1 => CLK48SEL::Pllsai1,
2 => CLK48SEL::Pll,
3 => CLK48SEL::Msi,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_hsi48(&self) -> bool {
*self == CLK48SEL::Hsi48
}
#[inline(always)]
pub fn is_pllsai1(&self) -> bool {
*self == CLK48SEL::Pllsai1
}
#[inline(always)]
pub fn is_pll(&self) -> bool {
*self == CLK48SEL::Pll
}
#[inline(always)]
pub fn is_msi(&self) -> bool {
*self == CLK48SEL::Msi
}
}
pub type CLK48SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CLK48SEL, crate::Safe>;
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 pllsai1(self) -> &'a mut crate::W<REG> {
self.variant(CLK48SEL::Pllsai1)
}
#[inline(always)]
pub fn pll(self) -> &'a mut crate::W<REG> {
self.variant(CLK48SEL::Pll)
}
#[inline(always)]
pub fn msi(self) -> &'a mut crate::W<REG> {
self.variant(CLK48SEL::Msi)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ADCSEL {
NoClock = 0,
Pllsai1 = 1,
Pllsai2 = 2,
Sysclk = 3,
}
impl From<ADCSEL> for u8 {
#[inline(always)]
fn from(variant: ADCSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for ADCSEL {
type Ux = u8;
}
impl crate::IsEnum for ADCSEL {}
pub type ADCSEL_R = crate::FieldReader<ADCSEL>;
impl ADCSEL_R {
#[inline(always)]
pub const fn variant(&self) -> ADCSEL {
match self.bits {
0 => ADCSEL::NoClock,
1 => ADCSEL::Pllsai1,
2 => ADCSEL::Pllsai2,
3 => ADCSEL::Sysclk,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_clock(&self) -> bool {
*self == ADCSEL::NoClock
}
#[inline(always)]
pub fn is_pllsai1(&self) -> bool {
*self == ADCSEL::Pllsai1
}
#[inline(always)]
pub fn is_pllsai2(&self) -> bool {
*self == ADCSEL::Pllsai2
}
#[inline(always)]
pub fn is_sysclk(&self) -> bool {
*self == ADCSEL::Sysclk
}
}
pub type ADCSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ADCSEL, crate::Safe>;
impl<'a, REG> ADCSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_clock(self) -> &'a mut crate::W<REG> {
self.variant(ADCSEL::NoClock)
}
#[inline(always)]
pub fn pllsai1(self) -> &'a mut crate::W<REG> {
self.variant(ADCSEL::Pllsai1)
}
#[inline(always)]
pub fn pllsai2(self) -> &'a mut crate::W<REG> {
self.variant(ADCSEL::Pllsai2)
}
#[inline(always)]
pub fn sysclk(self) -> &'a mut crate::W<REG> {
self.variant(ADCSEL::Sysclk)
}
}
pub type SWPMI1SEL_R = crate::BitReader;
pub type SWPMI1SEL_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 usart3sel(&self) -> USART3SEL_R {
USART3SEL_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn usart4sel(&self) -> USART4SEL_R {
USART4SEL_R::new(((self.bits >> 6) & 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 lptim2sel(&self) -> LPTIM2SEL_R {
LPTIM2SEL_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn sai1sel(&self) -> SAI1SEL_R {
SAI1SEL_R::new(((self.bits >> 22) & 3) as u8)
}
#[inline(always)]
pub fn clk48sel(&self) -> CLK48SEL_R {
CLK48SEL_R::new(((self.bits >> 26) & 3) as u8)
}
#[inline(always)]
pub fn adcsel(&self) -> ADCSEL_R {
ADCSEL_R::new(((self.bits >> 28) & 3) as u8)
}
#[inline(always)]
pub fn swpmi1sel(&self) -> SWPMI1SEL_R {
SWPMI1SEL_R::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCIPR")
.field("swpmi1sel", &self.swpmi1sel())
.field("adcsel", &self.adcsel())
.field("clk48sel", &self.clk48sel())
.field("sai1sel", &self.sai1sel())
.field("lptim1sel", &self.lptim1sel())
.field("lptim2sel", &self.lptim2sel())
.field("i2c1sel", &self.i2c1sel())
.field("i2c3sel", &self.i2c3sel())
.field("lpuart1sel", &self.lpuart1sel())
.field("usart1sel", &self.usart1sel())
.field("usart2sel", &self.usart2sel())
.field("usart4sel", &self.usart4sel())
.field("usart3sel", &self.usart3sel())
.field("i2c2sel", &self.i2c2sel())
.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 usart4sel(&mut self) -> USART4SEL_W<CCIPRrs> {
USART4SEL_W::new(self, 6)
}
#[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 lptim2sel(&mut self) -> LPTIM2SEL_W<CCIPRrs> {
LPTIM2SEL_W::new(self, 20)
}
#[inline(always)]
pub fn sai1sel(&mut self) -> SAI1SEL_W<CCIPRrs> {
SAI1SEL_W::new(self, 22)
}
#[inline(always)]
pub fn clk48sel(&mut self) -> CLK48SEL_W<CCIPRrs> {
CLK48SEL_W::new(self, 26)
}
#[inline(always)]
pub fn adcsel(&mut self) -> ADCSEL_W<CCIPRrs> {
ADCSEL_W::new(self, 28)
}
#[inline(always)]
pub fn swpmi1sel(&mut self) -> SWPMI1SEL_W<CCIPRrs> {
SWPMI1SEL_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 {}