pub type R = crate::R<CCIPR4rs>;
pub type W = crate::W<CCIPR4rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPUART1SEL {
Pclk4 = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
Lse = 5,
}
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) -> Option<LPUART1SEL> {
match self.bits {
0 => Some(LPUART1SEL::Pclk4),
1 => Some(LPUART1SEL::Pll2Q),
2 => Some(LPUART1SEL::Pll3Q),
3 => Some(LPUART1SEL::HsiKer),
4 => Some(LPUART1SEL::CsiKer),
5 => Some(LPUART1SEL::Lse),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk4(&self) -> bool {
*self == LPUART1SEL::Pclk4
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == LPUART1SEL::Pll2Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == LPUART1SEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == LPUART1SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == LPUART1SEL::CsiKer
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == LPUART1SEL::Lse
}
}
pub type LPUART1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, LPUART1SEL>;
impl<'a, REG> LPUART1SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk4(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::Pclk4)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::Pll2Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::Pll3Q)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(LPUART1SEL::CsiKer)
}
#[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 SPI6SEL {
Pclk4 = 0,
Pll2Q = 1,
Pll3Q = 2,
HsiKer = 3,
CsiKer = 4,
HseKer = 5,
}
impl From<SPI6SEL> for u8 {
#[inline(always)]
fn from(variant: SPI6SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for SPI6SEL {
type Ux = u8;
}
impl crate::IsEnum for SPI6SEL {}
pub type SPI6SEL_R = crate::FieldReader<SPI6SEL>;
impl SPI6SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SPI6SEL> {
match self.bits {
0 => Some(SPI6SEL::Pclk4),
1 => Some(SPI6SEL::Pll2Q),
2 => Some(SPI6SEL::Pll3Q),
3 => Some(SPI6SEL::HsiKer),
4 => Some(SPI6SEL::CsiKer),
5 => Some(SPI6SEL::HseKer),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk4(&self) -> bool {
*self == SPI6SEL::Pclk4
}
#[inline(always)]
pub fn is_pll2_q(&self) -> bool {
*self == SPI6SEL::Pll2Q
}
#[inline(always)]
pub fn is_pll3_q(&self) -> bool {
*self == SPI6SEL::Pll3Q
}
#[inline(always)]
pub fn is_hsi_ker(&self) -> bool {
*self == SPI6SEL::HsiKer
}
#[inline(always)]
pub fn is_csi_ker(&self) -> bool {
*self == SPI6SEL::CsiKer
}
#[inline(always)]
pub fn is_hse_ker(&self) -> bool {
*self == SPI6SEL::HseKer
}
}
pub type SPI6SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SPI6SEL>;
impl<'a, REG> SPI6SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk4(self) -> &'a mut crate::W<REG> {
self.variant(SPI6SEL::Pclk4)
}
#[inline(always)]
pub fn pll2_q(self) -> &'a mut crate::W<REG> {
self.variant(SPI6SEL::Pll2Q)
}
#[inline(always)]
pub fn pll3_q(self) -> &'a mut crate::W<REG> {
self.variant(SPI6SEL::Pll3Q)
}
#[inline(always)]
pub fn hsi_ker(self) -> &'a mut crate::W<REG> {
self.variant(SPI6SEL::HsiKer)
}
#[inline(always)]
pub fn csi_ker(self) -> &'a mut crate::W<REG> {
self.variant(SPI6SEL::CsiKer)
}
#[inline(always)]
pub fn hse_ker(self) -> &'a mut crate::W<REG> {
self.variant(SPI6SEL::HseKer)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPTIM23SEL {
Pclk4 = 0,
Pll2P = 1,
Pll3R = 2,
Lse = 3,
Lsi = 4,
Per = 5,
}
impl From<LPTIM23SEL> for u8 {
#[inline(always)]
fn from(variant: LPTIM23SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for LPTIM23SEL {
type Ux = u8;
}
impl crate::IsEnum for LPTIM23SEL {}
pub type LPTIM23SEL_R = crate::FieldReader<LPTIM23SEL>;
impl LPTIM23SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<LPTIM23SEL> {
match self.bits {
0 => Some(LPTIM23SEL::Pclk4),
1 => Some(LPTIM23SEL::Pll2P),
2 => Some(LPTIM23SEL::Pll3R),
3 => Some(LPTIM23SEL::Lse),
4 => Some(LPTIM23SEL::Lsi),
5 => Some(LPTIM23SEL::Per),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk4(&self) -> bool {
*self == LPTIM23SEL::Pclk4
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == LPTIM23SEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_r(&self) -> bool {
*self == LPTIM23SEL::Pll3R
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == LPTIM23SEL::Lse
}
#[inline(always)]
pub fn is_lsi(&self) -> bool {
*self == LPTIM23SEL::Lsi
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == LPTIM23SEL::Per
}
}
pub type LPTIM23SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, LPTIM23SEL>;
impl<'a, REG> LPTIM23SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk4(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM23SEL::Pclk4)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM23SEL::Pll2P)
}
#[inline(always)]
pub fn pll3_r(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM23SEL::Pll3R)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM23SEL::Lse)
}
#[inline(always)]
pub fn lsi(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM23SEL::Lsi)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM23SEL::Per)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LPTIM45SEL {
Pclk4 = 0,
Pll2P = 1,
Pll3R = 2,
Lse = 3,
Lsi = 4,
Per = 5,
}
impl From<LPTIM45SEL> for u8 {
#[inline(always)]
fn from(variant: LPTIM45SEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for LPTIM45SEL {
type Ux = u8;
}
impl crate::IsEnum for LPTIM45SEL {}
pub type LPTIM45SEL_R = crate::FieldReader<LPTIM45SEL>;
impl LPTIM45SEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<LPTIM45SEL> {
match self.bits {
0 => Some(LPTIM45SEL::Pclk4),
1 => Some(LPTIM45SEL::Pll2P),
2 => Some(LPTIM45SEL::Pll3R),
3 => Some(LPTIM45SEL::Lse),
4 => Some(LPTIM45SEL::Lsi),
5 => Some(LPTIM45SEL::Per),
_ => None,
}
}
#[inline(always)]
pub fn is_pclk4(&self) -> bool {
*self == LPTIM45SEL::Pclk4
}
#[inline(always)]
pub fn is_pll2_p(&self) -> bool {
*self == LPTIM45SEL::Pll2P
}
#[inline(always)]
pub fn is_pll3_r(&self) -> bool {
*self == LPTIM45SEL::Pll3R
}
#[inline(always)]
pub fn is_lse(&self) -> bool {
*self == LPTIM45SEL::Lse
}
#[inline(always)]
pub fn is_lsi(&self) -> bool {
*self == LPTIM45SEL::Lsi
}
#[inline(always)]
pub fn is_per(&self) -> bool {
*self == LPTIM45SEL::Per
}
}
pub type LPTIM45SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, LPTIM45SEL>;
impl<'a, REG> LPTIM45SEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn pclk4(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM45SEL::Pclk4)
}
#[inline(always)]
pub fn pll2_p(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM45SEL::Pll2P)
}
#[inline(always)]
pub fn pll3_r(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM45SEL::Pll3R)
}
#[inline(always)]
pub fn lse(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM45SEL::Lse)
}
#[inline(always)]
pub fn lsi(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM45SEL::Lsi)
}
#[inline(always)]
pub fn per(self) -> &'a mut crate::W<REG> {
self.variant(LPTIM45SEL::Per)
}
}
impl R {
#[inline(always)]
pub fn lpuart1sel(&self) -> LPUART1SEL_R {
LPUART1SEL_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn spi6sel(&self) -> SPI6SEL_R {
SPI6SEL_R::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn lptim23sel(&self) -> LPTIM23SEL_R {
LPTIM23SEL_R::new(((self.bits >> 8) & 7) as u8)
}
#[inline(always)]
pub fn lptim45sel(&self) -> LPTIM45SEL_R {
LPTIM45SEL_R::new(((self.bits >> 12) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCIPR4")
.field("lpuart1sel", &self.lpuart1sel())
.field("spi6sel", &self.spi6sel())
.field("lptim23sel", &self.lptim23sel())
.field("lptim45sel", &self.lptim45sel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn lpuart1sel(&mut self) -> LPUART1SEL_W<CCIPR4rs> {
LPUART1SEL_W::new(self, 0)
}
#[inline(always)]
pub fn spi6sel(&mut self) -> SPI6SEL_W<CCIPR4rs> {
SPI6SEL_W::new(self, 4)
}
#[inline(always)]
pub fn lptim23sel(&mut self) -> LPTIM23SEL_W<CCIPR4rs> {
LPTIM23SEL_W::new(self, 8)
}
#[inline(always)]
pub fn lptim45sel(&mut self) -> LPTIM45SEL_W<CCIPR4rs> {
LPTIM45SEL_W::new(self, 12)
}
}
pub struct CCIPR4rs;
impl crate::RegisterSpec for CCIPR4rs {
type Ux = u32;
}
impl crate::Readable for CCIPR4rs {}
impl crate::Writable for CCIPR4rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCIPR4rs {}