pub type R = crate::R<JSQRrs>;
pub type W = crate::W<JSQRrs>;
pub type JL_R = crate::FieldReader;
pub type JL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum JEXTSEL {
Tim1Trgo = 0,
Tim1Cc4 = 1,
Tim2Trgo = 2,
Tim2Cc1 = 3,
Tim3Cc4 = 4,
Tim4Trgo = 5,
Exti15 = 6,
Tim8Cc4 = 7,
Tim1Trgo2 = 8,
Tim8Trgo = 9,
Tim8Trgo2 = 10,
Tim3Cc3 = 11,
Tim3Trgo = 12,
Tim3Cc1 = 13,
Tim6Trgo = 14,
Tim15Trgo = 15,
Hrtim1Adctrg2 = 16,
Hrtim1Adctrg4 = 17,
Lptim1Out = 18,
Lptim2Out = 19,
Lptim3Out = 20,
}
impl From<JEXTSEL> for u8 {
#[inline(always)]
fn from(variant: JEXTSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for JEXTSEL {
type Ux = u8;
}
impl crate::IsEnum for JEXTSEL {}
pub type JEXTSEL_R = crate::FieldReader<JEXTSEL>;
impl JEXTSEL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<JEXTSEL> {
match self.bits {
0 => Some(JEXTSEL::Tim1Trgo),
1 => Some(JEXTSEL::Tim1Cc4),
2 => Some(JEXTSEL::Tim2Trgo),
3 => Some(JEXTSEL::Tim2Cc1),
4 => Some(JEXTSEL::Tim3Cc4),
5 => Some(JEXTSEL::Tim4Trgo),
6 => Some(JEXTSEL::Exti15),
7 => Some(JEXTSEL::Tim8Cc4),
8 => Some(JEXTSEL::Tim1Trgo2),
9 => Some(JEXTSEL::Tim8Trgo),
10 => Some(JEXTSEL::Tim8Trgo2),
11 => Some(JEXTSEL::Tim3Cc3),
12 => Some(JEXTSEL::Tim3Trgo),
13 => Some(JEXTSEL::Tim3Cc1),
14 => Some(JEXTSEL::Tim6Trgo),
15 => Some(JEXTSEL::Tim15Trgo),
16 => Some(JEXTSEL::Hrtim1Adctrg2),
17 => Some(JEXTSEL::Hrtim1Adctrg4),
18 => Some(JEXTSEL::Lptim1Out),
19 => Some(JEXTSEL::Lptim2Out),
20 => Some(JEXTSEL::Lptim3Out),
_ => None,
}
}
#[inline(always)]
pub fn is_tim1_trgo(&self) -> bool {
*self == JEXTSEL::Tim1Trgo
}
#[inline(always)]
pub fn is_tim1_cc4(&self) -> bool {
*self == JEXTSEL::Tim1Cc4
}
#[inline(always)]
pub fn is_tim2_trgo(&self) -> bool {
*self == JEXTSEL::Tim2Trgo
}
#[inline(always)]
pub fn is_tim2_cc1(&self) -> bool {
*self == JEXTSEL::Tim2Cc1
}
#[inline(always)]
pub fn is_tim3_cc4(&self) -> bool {
*self == JEXTSEL::Tim3Cc4
}
#[inline(always)]
pub fn is_tim4_trgo(&self) -> bool {
*self == JEXTSEL::Tim4Trgo
}
#[inline(always)]
pub fn is_exti15(&self) -> bool {
*self == JEXTSEL::Exti15
}
#[inline(always)]
pub fn is_tim8_cc4(&self) -> bool {
*self == JEXTSEL::Tim8Cc4
}
#[inline(always)]
pub fn is_tim1_trgo2(&self) -> bool {
*self == JEXTSEL::Tim1Trgo2
}
#[inline(always)]
pub fn is_tim8_trgo(&self) -> bool {
*self == JEXTSEL::Tim8Trgo
}
#[inline(always)]
pub fn is_tim8_trgo2(&self) -> bool {
*self == JEXTSEL::Tim8Trgo2
}
#[inline(always)]
pub fn is_tim3_cc3(&self) -> bool {
*self == JEXTSEL::Tim3Cc3
}
#[inline(always)]
pub fn is_tim3_trgo(&self) -> bool {
*self == JEXTSEL::Tim3Trgo
}
#[inline(always)]
pub fn is_tim3_cc1(&self) -> bool {
*self == JEXTSEL::Tim3Cc1
}
#[inline(always)]
pub fn is_tim6_trgo(&self) -> bool {
*self == JEXTSEL::Tim6Trgo
}
#[inline(always)]
pub fn is_tim15_trgo(&self) -> bool {
*self == JEXTSEL::Tim15Trgo
}
#[inline(always)]
pub fn is_hrtim1_adctrg2(&self) -> bool {
*self == JEXTSEL::Hrtim1Adctrg2
}
#[inline(always)]
pub fn is_hrtim1_adctrg4(&self) -> bool {
*self == JEXTSEL::Hrtim1Adctrg4
}
#[inline(always)]
pub fn is_lptim1_out(&self) -> bool {
*self == JEXTSEL::Lptim1Out
}
#[inline(always)]
pub fn is_lptim2_out(&self) -> bool {
*self == JEXTSEL::Lptim2Out
}
#[inline(always)]
pub fn is_lptim3_out(&self) -> bool {
*self == JEXTSEL::Lptim3Out
}
}
pub type JEXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 5, JEXTSEL>;
impl<'a, REG> JEXTSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn tim1_trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim1Trgo)
}
#[inline(always)]
pub fn tim1_cc4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim1Cc4)
}
#[inline(always)]
pub fn tim2_trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim2Trgo)
}
#[inline(always)]
pub fn tim2_cc1(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim2Cc1)
}
#[inline(always)]
pub fn tim3_cc4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim3Cc4)
}
#[inline(always)]
pub fn tim4_trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim4Trgo)
}
#[inline(always)]
pub fn exti15(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Exti15)
}
#[inline(always)]
pub fn tim8_cc4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim8Cc4)
}
#[inline(always)]
pub fn tim1_trgo2(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim1Trgo2)
}
#[inline(always)]
pub fn tim8_trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim8Trgo)
}
#[inline(always)]
pub fn tim8_trgo2(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim8Trgo2)
}
#[inline(always)]
pub fn tim3_cc3(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim3Cc3)
}
#[inline(always)]
pub fn tim3_trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim3Trgo)
}
#[inline(always)]
pub fn tim3_cc1(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim3Cc1)
}
#[inline(always)]
pub fn tim6_trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim6Trgo)
}
#[inline(always)]
pub fn tim15_trgo(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Tim15Trgo)
}
#[inline(always)]
pub fn hrtim1_adctrg2(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Hrtim1Adctrg2)
}
#[inline(always)]
pub fn hrtim1_adctrg4(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Hrtim1Adctrg4)
}
#[inline(always)]
pub fn lptim1_out(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Lptim1Out)
}
#[inline(always)]
pub fn lptim2_out(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Lptim2Out)
}
#[inline(always)]
pub fn lptim3_out(self) -> &'a mut crate::W<REG> {
self.variant(JEXTSEL::Lptim3Out)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum JEXTEN {
Disabled = 0,
RisingEdge = 1,
FallingEdge = 2,
BothEdges = 3,
}
impl From<JEXTEN> for u8 {
#[inline(always)]
fn from(variant: JEXTEN) -> Self {
variant as _
}
}
impl crate::FieldSpec for JEXTEN {
type Ux = u8;
}
impl crate::IsEnum for JEXTEN {}
pub type JEXTEN_R = crate::FieldReader<JEXTEN>;
impl JEXTEN_R {
#[inline(always)]
pub const fn variant(&self) -> JEXTEN {
match self.bits {
0 => JEXTEN::Disabled,
1 => JEXTEN::RisingEdge,
2 => JEXTEN::FallingEdge,
3 => JEXTEN::BothEdges,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JEXTEN::Disabled
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == JEXTEN::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == JEXTEN::FallingEdge
}
#[inline(always)]
pub fn is_both_edges(&self) -> bool {
*self == JEXTEN::BothEdges
}
}
pub type JEXTEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2, JEXTEN, crate::Safe>;
impl<'a, REG> JEXTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::Disabled)
}
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::FallingEdge)
}
#[inline(always)]
pub fn both_edges(self) -> &'a mut crate::W<REG> {
self.variant(JEXTEN::BothEdges)
}
}
pub type JSQ_R = crate::FieldReader;
pub type JSQ_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
impl R {
#[inline(always)]
pub fn jl(&self) -> JL_R {
JL_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn jextsel(&self) -> JEXTSEL_R {
JEXTSEL_R::new(((self.bits >> 2) & 0x1f) as u8)
}
#[inline(always)]
pub fn jexten(&self) -> JEXTEN_R {
JEXTEN_R::new(((self.bits >> 7) & 3) as u8)
}
#[inline(always)]
pub fn jsq(&self, n: u8) -> JSQ_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
JSQ_R::new(((self.bits >> (n * 6 + 9)) & 0x1f) as u8)
}
#[inline(always)]
pub fn jsq_iter(&self) -> impl Iterator<Item = JSQ_R> + '_ {
(0..4).map(move |n| JSQ_R::new(((self.bits >> (n * 6 + 9)) & 0x1f) as u8))
}
#[inline(always)]
pub fn jsq1(&self) -> JSQ_R {
JSQ_R::new(((self.bits >> 9) & 0x1f) as u8)
}
#[inline(always)]
pub fn jsq2(&self) -> JSQ_R {
JSQ_R::new(((self.bits >> 15) & 0x1f) as u8)
}
#[inline(always)]
pub fn jsq3(&self) -> JSQ_R {
JSQ_R::new(((self.bits >> 21) & 0x1f) as u8)
}
#[inline(always)]
pub fn jsq4(&self) -> JSQ_R {
JSQ_R::new(((self.bits >> 27) & 0x1f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("JSQR")
.field("jsq1", &self.jsq1())
.field("jsq2", &self.jsq2())
.field("jsq3", &self.jsq3())
.field("jsq4", &self.jsq4())
.field("jexten", &self.jexten())
.field("jextsel", &self.jextsel())
.field("jl", &self.jl())
.finish()
}
}
impl W {
#[inline(always)]
pub fn jl(&mut self) -> JL_W<JSQRrs> {
JL_W::new(self, 0)
}
#[inline(always)]
pub fn jextsel(&mut self) -> JEXTSEL_W<JSQRrs> {
JEXTSEL_W::new(self, 2)
}
#[inline(always)]
pub fn jexten(&mut self) -> JEXTEN_W<JSQRrs> {
JEXTEN_W::new(self, 7)
}
#[inline(always)]
pub fn jsq(&mut self, n: u8) -> JSQ_W<JSQRrs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
JSQ_W::new(self, n * 6 + 9)
}
#[inline(always)]
pub fn jsq1(&mut self) -> JSQ_W<JSQRrs> {
JSQ_W::new(self, 9)
}
#[inline(always)]
pub fn jsq2(&mut self) -> JSQ_W<JSQRrs> {
JSQ_W::new(self, 15)
}
#[inline(always)]
pub fn jsq3(&mut self) -> JSQ_W<JSQRrs> {
JSQ_W::new(self, 21)
}
#[inline(always)]
pub fn jsq4(&mut self) -> JSQ_W<JSQRrs> {
JSQ_W::new(self, 27)
}
}
pub struct JSQRrs;
impl crate::RegisterSpec for JSQRrs {
type Ux = u32;
}
impl crate::Readable for JSQRrs {}
impl crate::Writable for JSQRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for JSQRrs {}