pub type R = crate::R<HYSTERESIS0rs>;
pub type W = crate::W<HYSTERESIS0rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum HYST {
Hyst0 = 0,
Hyst1 = 1,
Hyst2 = 2,
Hyst3 = 3,
Hyst4 = 4,
Hyst5 = 5,
Hyst6 = 6,
Hyst7 = 7,
Hyst8 = 8,
Hyst9 = 9,
Hyst10 = 10,
Hyst11 = 11,
Hyst12 = 12,
Hyst13 = 13,
Hyst14 = 14,
Hyst15 = 15,
}
impl From<HYST> for u8 {
#[inline(always)]
fn from(variant: HYST) -> Self {
variant as _
}
}
impl crate::FieldSpec for HYST {
type Ux = u8;
}
impl crate::IsEnum for HYST {}
pub type HystR = crate::FieldReader<HYST>;
impl HystR {
#[inline(always)]
pub const fn variant(&self) -> HYST {
match self.bits {
0 => HYST::Hyst0,
1 => HYST::Hyst1,
2 => HYST::Hyst2,
3 => HYST::Hyst3,
4 => HYST::Hyst4,
5 => HYST::Hyst5,
6 => HYST::Hyst6,
7 => HYST::Hyst7,
8 => HYST::Hyst8,
9 => HYST::Hyst9,
10 => HYST::Hyst10,
11 => HYST::Hyst11,
12 => HYST::Hyst12,
13 => HYST::Hyst13,
14 => HYST::Hyst14,
15 => HYST::Hyst15,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_hyst0(&self) -> bool {
*self == HYST::Hyst0
}
#[inline(always)]
pub fn is_hyst1(&self) -> bool {
*self == HYST::Hyst1
}
#[inline(always)]
pub fn is_hyst2(&self) -> bool {
*self == HYST::Hyst2
}
#[inline(always)]
pub fn is_hyst3(&self) -> bool {
*self == HYST::Hyst3
}
#[inline(always)]
pub fn is_hyst4(&self) -> bool {
*self == HYST::Hyst4
}
#[inline(always)]
pub fn is_hyst5(&self) -> bool {
*self == HYST::Hyst5
}
#[inline(always)]
pub fn is_hyst6(&self) -> bool {
*self == HYST::Hyst6
}
#[inline(always)]
pub fn is_hyst7(&self) -> bool {
*self == HYST::Hyst7
}
#[inline(always)]
pub fn is_hyst8(&self) -> bool {
*self == HYST::Hyst8
}
#[inline(always)]
pub fn is_hyst9(&self) -> bool {
*self == HYST::Hyst9
}
#[inline(always)]
pub fn is_hyst10(&self) -> bool {
*self == HYST::Hyst10
}
#[inline(always)]
pub fn is_hyst11(&self) -> bool {
*self == HYST::Hyst11
}
#[inline(always)]
pub fn is_hyst12(&self) -> bool {
*self == HYST::Hyst12
}
#[inline(always)]
pub fn is_hyst13(&self) -> bool {
*self == HYST::Hyst13
}
#[inline(always)]
pub fn is_hyst14(&self) -> bool {
*self == HYST::Hyst14
}
#[inline(always)]
pub fn is_hyst15(&self) -> bool {
*self == HYST::Hyst15
}
}
pub type HystW<'a, REG> = crate::FieldWriter<'a, REG, 4, HYST, crate::Safe>;
impl<'a, REG> HystW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn hyst0(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst0)
}
#[inline(always)]
pub fn hyst1(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst1)
}
#[inline(always)]
pub fn hyst2(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst2)
}
#[inline(always)]
pub fn hyst3(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst3)
}
#[inline(always)]
pub fn hyst4(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst4)
}
#[inline(always)]
pub fn hyst5(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst5)
}
#[inline(always)]
pub fn hyst6(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst6)
}
#[inline(always)]
pub fn hyst7(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst7)
}
#[inline(always)]
pub fn hyst8(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst8)
}
#[inline(always)]
pub fn hyst9(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst9)
}
#[inline(always)]
pub fn hyst10(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst10)
}
#[inline(always)]
pub fn hyst11(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst11)
}
#[inline(always)]
pub fn hyst12(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst12)
}
#[inline(always)]
pub fn hyst13(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst13)
}
#[inline(always)]
pub fn hyst14(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst14)
}
#[inline(always)]
pub fn hyst15(self) -> &'a mut crate::W<REG> {
self.variant(HYST::Hyst15)
}
}
pub type DivvaR = crate::FieldReader;
pub type DivvaW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
pub type DivvbR = crate::FieldReader;
pub type DivvbW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
impl R {
#[inline(always)]
pub fn hyst(&self) -> HystR {
HystR::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn divva(&self) -> DivvaR {
DivvaR::new(((self.bits >> 16) & 0x3f) as u8)
}
#[inline(always)]
pub fn divvb(&self) -> DivvbR {
DivvbR::new(((self.bits >> 24) & 0x3f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("HYSTERESIS0")
.field("hyst", &self.hyst())
.field("divva", &self.divva())
.field("divvb", &self.divvb())
.finish()
}
}
impl W {
#[inline(always)]
pub fn hyst(&mut self) -> HystW<'_, HYSTERESIS0rs> {
HystW::new(self, 0)
}
#[inline(always)]
pub fn divva(&mut self) -> DivvaW<'_, HYSTERESIS0rs> {
DivvaW::new(self, 16)
}
#[inline(always)]
pub fn divvb(&mut self) -> DivvbW<'_, HYSTERESIS0rs> {
DivvbW::new(self, 24)
}
}
pub struct HYSTERESIS0rs;
impl crate::RegisterSpec for HYSTERESIS0rs {
type Ux = u32;
}
impl crate::Readable for HYSTERESIS0rs {}
impl crate::Writable for HYSTERESIS0rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for HYSTERESIS0rs {}