pub type R = crate::R<AFRHrs>;
pub type W = crate::W<AFRHrs>;
pub use super::afrl::AFR_R;
pub use super::afrl::AFR_W;
pub use super::afrl::ALTERNATE_FUNCTION;
impl R {
#[inline(always)]
pub fn afr(&self, n: u8) -> AFR_R {
#[allow(clippy::no_effect)]
[(); 8][n as usize];
AFR_R::new(((self.bits >> (n * 4)) & 0x0f) as u8)
}
#[inline(always)]
pub fn afr_iter(&self) -> impl Iterator<Item = AFR_R> + '_ {
(0..8).map(move |n| AFR_R::new(((self.bits >> (n * 4)) & 0x0f) as u8))
}
#[inline(always)]
pub fn afrel8(&self) -> AFR_R {
AFR_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn afrel9(&self) -> AFR_R {
AFR_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn afrel10(&self) -> AFR_R {
AFR_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn afrel11(&self) -> AFR_R {
AFR_R::new(((self.bits >> 12) & 0x0f) as u8)
}
#[inline(always)]
pub fn afrel12(&self) -> AFR_R {
AFR_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn afrel13(&self) -> AFR_R {
AFR_R::new(((self.bits >> 20) & 0x0f) as u8)
}
#[inline(always)]
pub fn afrel14(&self) -> AFR_R {
AFR_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn afrel15(&self) -> AFR_R {
AFR_R::new(((self.bits >> 28) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AFRH")
.field("afrel8", &self.afrel8())
.field("afrel9", &self.afrel9())
.field("afrel10", &self.afrel10())
.field("afrel11", &self.afrel11())
.field("afrel12", &self.afrel12())
.field("afrel13", &self.afrel13())
.field("afrel14", &self.afrel14())
.field("afrel15", &self.afrel15())
.finish()
}
}
impl W {
#[inline(always)]
pub fn afr(&mut self, n: u8) -> AFR_W<AFRHrs> {
#[allow(clippy::no_effect)]
[(); 8][n as usize];
AFR_W::new(self, n * 4)
}
#[inline(always)]
pub fn afrel8(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 0)
}
#[inline(always)]
pub fn afrel9(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 4)
}
#[inline(always)]
pub fn afrel10(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 8)
}
#[inline(always)]
pub fn afrel11(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 12)
}
#[inline(always)]
pub fn afrel12(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 16)
}
#[inline(always)]
pub fn afrel13(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 20)
}
#[inline(always)]
pub fn afrel14(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 24)
}
#[inline(always)]
pub fn afrel15(&mut self) -> AFR_W<AFRHrs> {
AFR_W::new(self, 28)
}
}
pub struct AFRHrs;
impl crate::RegisterSpec for AFRHrs {
type Ux = u32;
}
impl crate::Readable for AFRHrs {}
impl crate::Writable for AFRHrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AFRHrs {}