stm32f1_staging/stm32f103/afio/exticr2.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
///Register `EXTICR2` reader
pub type R = crate::R<EXTICR2rs>;
///Register `EXTICR2` writer
pub type W = crate::W<EXTICR2rs>;
///Field `EXTI4` reader - EXTI4 configuration
pub type EXTI4_R = crate::FieldReader;
///Field `EXTI4` writer - EXTI4 configuration
pub type EXTI4_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
///Field `EXTI5` reader - EXTI5 configuration
pub type EXTI5_R = crate::FieldReader;
///Field `EXTI5` writer - EXTI5 configuration
pub type EXTI5_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
///Field `EXTI6` reader - EXTI6 configuration
pub type EXTI6_R = crate::FieldReader;
///Field `EXTI6` writer - EXTI6 configuration
pub type EXTI6_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
///Field `EXTI7` reader - EXTI7 configuration
pub type EXTI7_R = crate::FieldReader;
///Field `EXTI7` writer - EXTI7 configuration
pub type EXTI7_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
impl R {
///Bits 0:3 - EXTI4 configuration
#[inline(always)]
pub fn exti4(&self) -> EXTI4_R {
EXTI4_R::new((self.bits & 0x0f) as u8)
}
///Bits 4:7 - EXTI5 configuration
#[inline(always)]
pub fn exti5(&self) -> EXTI5_R {
EXTI5_R::new(((self.bits >> 4) & 0x0f) as u8)
}
///Bits 8:11 - EXTI6 configuration
#[inline(always)]
pub fn exti6(&self) -> EXTI6_R {
EXTI6_R::new(((self.bits >> 8) & 0x0f) as u8)
}
///Bits 12:15 - EXTI7 configuration
#[inline(always)]
pub fn exti7(&self) -> EXTI7_R {
EXTI7_R::new(((self.bits >> 12) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EXTICR2")
.field("exti4", &self.exti4())
.field("exti5", &self.exti5())
.field("exti6", &self.exti6())
.field("exti7", &self.exti7())
.finish()
}
}
impl W {
///Bits 0:3 - EXTI4 configuration
#[inline(always)]
#[must_use]
pub fn exti4(&mut self) -> EXTI4_W<EXTICR2rs> {
EXTI4_W::new(self, 0)
}
///Bits 4:7 - EXTI5 configuration
#[inline(always)]
#[must_use]
pub fn exti5(&mut self) -> EXTI5_W<EXTICR2rs> {
EXTI5_W::new(self, 4)
}
///Bits 8:11 - EXTI6 configuration
#[inline(always)]
#[must_use]
pub fn exti6(&mut self) -> EXTI6_W<EXTICR2rs> {
EXTI6_W::new(self, 8)
}
///Bits 12:15 - EXTI7 configuration
#[inline(always)]
#[must_use]
pub fn exti7(&mut self) -> EXTI7_W<EXTICR2rs> {
EXTI7_W::new(self, 12)
}
}
/**External interrupt configuration register 2 (AFIO_EXTICR2)
You can [`read`](crate::Reg::read) this register and get [`exticr2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`exticr2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F103.html#AFIO:EXTICR2)*/
pub struct EXTICR2rs;
impl crate::RegisterSpec for EXTICR2rs {
type Ux = u32;
}
///`read()` method returns [`exticr2::R`](R) reader structure
impl crate::Readable for EXTICR2rs {}
///`write(|w| ..)` method takes [`exticr2::W`](W) writer structure
impl crate::Writable for EXTICR2rs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
///`reset()` method sets EXTICR2 to value 0
impl crate::Resettable for EXTICR2rs {
const RESET_VALUE: u32 = 0;
}