#[doc = "Reader of register EXTICR1"]
pub type R = crate::R<u32, super::EXTICR1>;
#[doc = "Writer for register EXTICR1"]
pub type W = crate::W<u32, super::EXTICR1>;
#[doc = "Register EXTICR1 `reset()`'s with value 0"]
impl crate::ResetValue for super::EXTICR1 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "EXTI x configuration (x = 0 to 3)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EXTI3_A {
#[doc = "0: Select PA3 as the source input for the EXTI3 external interrupt"]
PA3,
#[doc = "1: Select PB3 as the source input for the EXTI3 external interrupt"]
PB3,
#[doc = "2: Select PC3 as the source input for the EXTI3 external interrupt"]
PC3,
#[doc = "3: Select PD3 as the source input for the EXTI3 external interrupt"]
PD3,
#[doc = "4: Select PE3 as the source input for the EXTI3 external interrupt"]
PE3,
#[doc = "5: Select PH3 as the source input for the EXTI3 external interrupt"]
PH3,
}
impl From<EXTI3_A> for u8 {
#[inline(always)]
fn from(variant: EXTI3_A) -> Self {
match variant {
EXTI3_A::PA3 => 0,
EXTI3_A::PB3 => 1,
EXTI3_A::PC3 => 2,
EXTI3_A::PD3 => 3,
EXTI3_A::PE3 => 4,
EXTI3_A::PH3 => 5,
}
}
}
#[doc = "Reader of field `EXTI3`"]
pub type EXTI3_R = crate::R<u8, EXTI3_A>;
impl EXTI3_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, EXTI3_A> {
use crate::Variant::*;
match self.bits {
0 => Val(EXTI3_A::PA3),
1 => Val(EXTI3_A::PB3),
2 => Val(EXTI3_A::PC3),
3 => Val(EXTI3_A::PD3),
4 => Val(EXTI3_A::PE3),
5 => Val(EXTI3_A::PH3),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `PA3`"]
#[inline(always)]
pub fn is_pa3(&self) -> bool {
*self == EXTI3_A::PA3
}
#[doc = "Checks if the value of the field is `PB3`"]
#[inline(always)]
pub fn is_pb3(&self) -> bool {
*self == EXTI3_A::PB3
}
#[doc = "Checks if the value of the field is `PC3`"]
#[inline(always)]
pub fn is_pc3(&self) -> bool {
*self == EXTI3_A::PC3
}
#[doc = "Checks if the value of the field is `PD3`"]
#[inline(always)]
pub fn is_pd3(&self) -> bool {
*self == EXTI3_A::PD3
}
#[doc = "Checks if the value of the field is `PE3`"]
#[inline(always)]
pub fn is_pe3(&self) -> bool {
*self == EXTI3_A::PE3
}
#[doc = "Checks if the value of the field is `PH3`"]
#[inline(always)]
pub fn is_ph3(&self) -> bool {
*self == EXTI3_A::PH3
}
}
#[doc = "Write proxy for field `EXTI3`"]
pub struct EXTI3_W<'a> {
w: &'a mut W,
}
impl<'a> EXTI3_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EXTI3_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Select PA3 as the source input for the EXTI3 external interrupt"]
#[inline(always)]
pub fn pa3(self) -> &'a mut W {
self.variant(EXTI3_A::PA3)
}
#[doc = "Select PB3 as the source input for the EXTI3 external interrupt"]
#[inline(always)]
pub fn pb3(self) -> &'a mut W {
self.variant(EXTI3_A::PB3)
}
#[doc = "Select PC3 as the source input for the EXTI3 external interrupt"]
#[inline(always)]
pub fn pc3(self) -> &'a mut W {
self.variant(EXTI3_A::PC3)
}
#[doc = "Select PD3 as the source input for the EXTI3 external interrupt"]
#[inline(always)]
pub fn pd3(self) -> &'a mut W {
self.variant(EXTI3_A::PD3)
}
#[doc = "Select PE3 as the source input for the EXTI3 external interrupt"]
#[inline(always)]
pub fn pe3(self) -> &'a mut W {
self.variant(EXTI3_A::PE3)
}
#[doc = "Select PH3 as the source input for the EXTI3 external interrupt"]
#[inline(always)]
pub fn ph3(self) -> &'a mut W {
self.variant(EXTI3_A::PH3)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12);
self.w
}
}
#[doc = "EXTI x configuration (x = 0 to 3)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EXTI2_A {
#[doc = "0: Select PA2 as the source input for the EXTI2 external interrupt"]
PA2,
#[doc = "1: Select PB2 as the source input for the EXTI2 external interrupt"]
PB2,
#[doc = "2: Select PC2 as the source input for the EXTI2 external interrupt"]
PC2,
#[doc = "3: Select PD2 as the source input for the EXTI2 external interrupt"]
PD2,
#[doc = "4: Select PE2 as the source input for the EXTI2 external interrupt"]
PE2,
#[doc = "5: Select PH2 as the source input for the EXTI2 external interrupt"]
PH2,
}
impl From<EXTI2_A> for u8 {
#[inline(always)]
fn from(variant: EXTI2_A) -> Self {
match variant {
EXTI2_A::PA2 => 0,
EXTI2_A::PB2 => 1,
EXTI2_A::PC2 => 2,
EXTI2_A::PD2 => 3,
EXTI2_A::PE2 => 4,
EXTI2_A::PH2 => 5,
}
}
}
#[doc = "Reader of field `EXTI2`"]
pub type EXTI2_R = crate::R<u8, EXTI2_A>;
impl EXTI2_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, EXTI2_A> {
use crate::Variant::*;
match self.bits {
0 => Val(EXTI2_A::PA2),
1 => Val(EXTI2_A::PB2),
2 => Val(EXTI2_A::PC2),
3 => Val(EXTI2_A::PD2),
4 => Val(EXTI2_A::PE2),
5 => Val(EXTI2_A::PH2),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `PA2`"]
#[inline(always)]
pub fn is_pa2(&self) -> bool {
*self == EXTI2_A::PA2
}
#[doc = "Checks if the value of the field is `PB2`"]
#[inline(always)]
pub fn is_pb2(&self) -> bool {
*self == EXTI2_A::PB2
}
#[doc = "Checks if the value of the field is `PC2`"]
#[inline(always)]
pub fn is_pc2(&self) -> bool {
*self == EXTI2_A::PC2
}
#[doc = "Checks if the value of the field is `PD2`"]
#[inline(always)]
pub fn is_pd2(&self) -> bool {
*self == EXTI2_A::PD2
}
#[doc = "Checks if the value of the field is `PE2`"]
#[inline(always)]
pub fn is_pe2(&self) -> bool {
*self == EXTI2_A::PE2
}
#[doc = "Checks if the value of the field is `PH2`"]
#[inline(always)]
pub fn is_ph2(&self) -> bool {
*self == EXTI2_A::PH2
}
}
#[doc = "Write proxy for field `EXTI2`"]
pub struct EXTI2_W<'a> {
w: &'a mut W,
}
impl<'a> EXTI2_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EXTI2_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Select PA2 as the source input for the EXTI2 external interrupt"]
#[inline(always)]
pub fn pa2(self) -> &'a mut W {
self.variant(EXTI2_A::PA2)
}
#[doc = "Select PB2 as the source input for the EXTI2 external interrupt"]
#[inline(always)]
pub fn pb2(self) -> &'a mut W {
self.variant(EXTI2_A::PB2)
}
#[doc = "Select PC2 as the source input for the EXTI2 external interrupt"]
#[inline(always)]
pub fn pc2(self) -> &'a mut W {
self.variant(EXTI2_A::PC2)
}
#[doc = "Select PD2 as the source input for the EXTI2 external interrupt"]
#[inline(always)]
pub fn pd2(self) -> &'a mut W {
self.variant(EXTI2_A::PD2)
}
#[doc = "Select PE2 as the source input for the EXTI2 external interrupt"]
#[inline(always)]
pub fn pe2(self) -> &'a mut W {
self.variant(EXTI2_A::PE2)
}
#[doc = "Select PH2 as the source input for the EXTI2 external interrupt"]
#[inline(always)]
pub fn ph2(self) -> &'a mut W {
self.variant(EXTI2_A::PH2)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8);
self.w
}
}
#[doc = "EXTI x configuration (x = 0 to 3)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EXTI1_A {
#[doc = "0: Select PA1 as the source input for the EXTI1 external interrupt"]
PA1,
#[doc = "1: Select PB1 as the source input for the EXTI1 external interrupt"]
PB1,
#[doc = "2: Select PC1 as the source input for the EXTI1 external interrupt"]
PC1,
#[doc = "3: Select PD1 as the source input for the EXTI1 external interrupt"]
PD1,
#[doc = "4: Select PE1 as the source input for the EXTI1 external interrupt"]
PE1,
#[doc = "5: Select PH1 as the source input for the EXTI1 external interrupt"]
PH1,
}
impl From<EXTI1_A> for u8 {
#[inline(always)]
fn from(variant: EXTI1_A) -> Self {
match variant {
EXTI1_A::PA1 => 0,
EXTI1_A::PB1 => 1,
EXTI1_A::PC1 => 2,
EXTI1_A::PD1 => 3,
EXTI1_A::PE1 => 4,
EXTI1_A::PH1 => 5,
}
}
}
#[doc = "Reader of field `EXTI1`"]
pub type EXTI1_R = crate::R<u8, EXTI1_A>;
impl EXTI1_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, EXTI1_A> {
use crate::Variant::*;
match self.bits {
0 => Val(EXTI1_A::PA1),
1 => Val(EXTI1_A::PB1),
2 => Val(EXTI1_A::PC1),
3 => Val(EXTI1_A::PD1),
4 => Val(EXTI1_A::PE1),
5 => Val(EXTI1_A::PH1),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `PA1`"]
#[inline(always)]
pub fn is_pa1(&self) -> bool {
*self == EXTI1_A::PA1
}
#[doc = "Checks if the value of the field is `PB1`"]
#[inline(always)]
pub fn is_pb1(&self) -> bool {
*self == EXTI1_A::PB1
}
#[doc = "Checks if the value of the field is `PC1`"]
#[inline(always)]
pub fn is_pc1(&self) -> bool {
*self == EXTI1_A::PC1
}
#[doc = "Checks if the value of the field is `PD1`"]
#[inline(always)]
pub fn is_pd1(&self) -> bool {
*self == EXTI1_A::PD1
}
#[doc = "Checks if the value of the field is `PE1`"]
#[inline(always)]
pub fn is_pe1(&self) -> bool {
*self == EXTI1_A::PE1
}
#[doc = "Checks if the value of the field is `PH1`"]
#[inline(always)]
pub fn is_ph1(&self) -> bool {
*self == EXTI1_A::PH1
}
}
#[doc = "Write proxy for field `EXTI1`"]
pub struct EXTI1_W<'a> {
w: &'a mut W,
}
impl<'a> EXTI1_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EXTI1_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Select PA1 as the source input for the EXTI1 external interrupt"]
#[inline(always)]
pub fn pa1(self) -> &'a mut W {
self.variant(EXTI1_A::PA1)
}
#[doc = "Select PB1 as the source input for the EXTI1 external interrupt"]
#[inline(always)]
pub fn pb1(self) -> &'a mut W {
self.variant(EXTI1_A::PB1)
}
#[doc = "Select PC1 as the source input for the EXTI1 external interrupt"]
#[inline(always)]
pub fn pc1(self) -> &'a mut W {
self.variant(EXTI1_A::PC1)
}
#[doc = "Select PD1 as the source input for the EXTI1 external interrupt"]
#[inline(always)]
pub fn pd1(self) -> &'a mut W {
self.variant(EXTI1_A::PD1)
}
#[doc = "Select PE1 as the source input for the EXTI1 external interrupt"]
#[inline(always)]
pub fn pe1(self) -> &'a mut W {
self.variant(EXTI1_A::PE1)
}
#[doc = "Select PH1 as the source input for the EXTI1 external interrupt"]
#[inline(always)]
pub fn ph1(self) -> &'a mut W {
self.variant(EXTI1_A::PH1)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4);
self.w
}
}
#[doc = "EXTI x configuration (x = 0 to 3)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EXTI0_A {
#[doc = "0: Select PA0 as the source input for the EXTI0 external interrupt"]
PA0,
#[doc = "1: Select PB0 as the source input for the EXTI0 external interrupt"]
PB0,
#[doc = "2: Select PC0 as the source input for the EXTI0 external interrupt"]
PC0,
#[doc = "3: Select PD0 as the source input for the EXTI0 external interrupt"]
PD0,
#[doc = "4: Select PE0 as the source input for the EXTI0 external interrupt"]
PE0,
#[doc = "5: Select PH0 as the source input for the EXTI0 external interrupt"]
PH0,
}
impl From<EXTI0_A> for u8 {
#[inline(always)]
fn from(variant: EXTI0_A) -> Self {
match variant {
EXTI0_A::PA0 => 0,
EXTI0_A::PB0 => 1,
EXTI0_A::PC0 => 2,
EXTI0_A::PD0 => 3,
EXTI0_A::PE0 => 4,
EXTI0_A::PH0 => 5,
}
}
}
#[doc = "Reader of field `EXTI0`"]
pub type EXTI0_R = crate::R<u8, EXTI0_A>;
impl EXTI0_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, EXTI0_A> {
use crate::Variant::*;
match self.bits {
0 => Val(EXTI0_A::PA0),
1 => Val(EXTI0_A::PB0),
2 => Val(EXTI0_A::PC0),
3 => Val(EXTI0_A::PD0),
4 => Val(EXTI0_A::PE0),
5 => Val(EXTI0_A::PH0),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `PA0`"]
#[inline(always)]
pub fn is_pa0(&self) -> bool {
*self == EXTI0_A::PA0
}
#[doc = "Checks if the value of the field is `PB0`"]
#[inline(always)]
pub fn is_pb0(&self) -> bool {
*self == EXTI0_A::PB0
}
#[doc = "Checks if the value of the field is `PC0`"]
#[inline(always)]
pub fn is_pc0(&self) -> bool {
*self == EXTI0_A::PC0
}
#[doc = "Checks if the value of the field is `PD0`"]
#[inline(always)]
pub fn is_pd0(&self) -> bool {
*self == EXTI0_A::PD0
}
#[doc = "Checks if the value of the field is `PE0`"]
#[inline(always)]
pub fn is_pe0(&self) -> bool {
*self == EXTI0_A::PE0
}
#[doc = "Checks if the value of the field is `PH0`"]
#[inline(always)]
pub fn is_ph0(&self) -> bool {
*self == EXTI0_A::PH0
}
}
#[doc = "Write proxy for field `EXTI0`"]
pub struct EXTI0_W<'a> {
w: &'a mut W,
}
impl<'a> EXTI0_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EXTI0_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Select PA0 as the source input for the EXTI0 external interrupt"]
#[inline(always)]
pub fn pa0(self) -> &'a mut W {
self.variant(EXTI0_A::PA0)
}
#[doc = "Select PB0 as the source input for the EXTI0 external interrupt"]
#[inline(always)]
pub fn pb0(self) -> &'a mut W {
self.variant(EXTI0_A::PB0)
}
#[doc = "Select PC0 as the source input for the EXTI0 external interrupt"]
#[inline(always)]
pub fn pc0(self) -> &'a mut W {
self.variant(EXTI0_A::PC0)
}
#[doc = "Select PD0 as the source input for the EXTI0 external interrupt"]
#[inline(always)]
pub fn pd0(self) -> &'a mut W {
self.variant(EXTI0_A::PD0)
}
#[doc = "Select PE0 as the source input for the EXTI0 external interrupt"]
#[inline(always)]
pub fn pe0(self) -> &'a mut W {
self.variant(EXTI0_A::PE0)
}
#[doc = "Select PH0 as the source input for the EXTI0 external interrupt"]
#[inline(always)]
pub fn ph0(self) -> &'a mut W {
self.variant(EXTI0_A::PH0)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f);
self.w
}
}
impl R {
#[doc = "Bits 12:15 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti3(&self) -> EXTI3_R {
EXTI3_R::new(((self.bits >> 12) & 0x0f) as u8)
}
#[doc = "Bits 8:11 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti2(&self) -> EXTI2_R {
EXTI2_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[doc = "Bits 4:7 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti1(&self) -> EXTI1_R {
EXTI1_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[doc = "Bits 0:3 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti0(&self) -> EXTI0_R {
EXTI0_R::new((self.bits & 0x0f) as u8)
}
}
impl W {
#[doc = "Bits 12:15 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti3(&mut self) -> EXTI3_W {
EXTI3_W { w: self }
}
#[doc = "Bits 8:11 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti2(&mut self) -> EXTI2_W {
EXTI2_W { w: self }
}
#[doc = "Bits 4:7 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti1(&mut self) -> EXTI1_W {
EXTI1_W { w: self }
}
#[doc = "Bits 0:3 - EXTI x configuration (x = 0 to 3)"]
#[inline(always)]
pub fn exti0(&mut self) -> EXTI0_W {
EXTI0_W { w: self }
}
}