s32k118.rs/src/cmu_fc_1/ier.rs

357 lines
10 KiB
Rust

#[doc = "Reader of register IER"]
pub type R = crate::R<u32, super::IER>;
#[doc = "Writer for register IER"]
pub type W = crate::W<u32, super::IER>;
#[doc = "Register IER `reset()`'s with value 0"]
impl crate::ResetValue for super::IER {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Frequency Lower than Low Frequency Reference Threshold Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FLLIE_A {
#[doc = "0: FLL Interrupt is Disabled"]
_0 = 0,
#[doc = "1: FLL Interrupt is Enabled"]
_1 = 1,
}
impl From<FLLIE_A> for bool {
#[inline(always)]
fn from(variant: FLLIE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `FLLIE`"]
pub type FLLIE_R = crate::R<bool, FLLIE_A>;
impl FLLIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FLLIE_A {
match self.bits {
false => FLLIE_A::_0,
true => FLLIE_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == FLLIE_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == FLLIE_A::_1
}
}
#[doc = "Write proxy for field `FLLIE`"]
pub struct FLLIE_W<'a> {
w: &'a mut W,
}
impl<'a> FLLIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FLLIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "FLL Interrupt is Disabled"]
#[inline(always)]
pub fn _0(self) -> &'a mut W {
self.variant(FLLIE_A::_0)
}
#[doc = "FLL Interrupt is Enabled"]
#[inline(always)]
pub fn _1(self) -> &'a mut W {
self.variant(FLLIE_A::_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
self.w
}
}
#[doc = "Frequency Higher than High Frequency Reference Threshold Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FHHIE_A {
#[doc = "0: FHH Interrupt is Disabled"]
_0 = 0,
#[doc = "1: FHH Interrupt is Enabled"]
_1 = 1,
}
impl From<FHHIE_A> for bool {
#[inline(always)]
fn from(variant: FHHIE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `FHHIE`"]
pub type FHHIE_R = crate::R<bool, FHHIE_A>;
impl FHHIE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FHHIE_A {
match self.bits {
false => FHHIE_A::_0,
true => FHHIE_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == FHHIE_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == FHHIE_A::_1
}
}
#[doc = "Write proxy for field `FHHIE`"]
pub struct FHHIE_W<'a> {
w: &'a mut W,
}
impl<'a> FHHIE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FHHIE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "FHH Interrupt is Disabled"]
#[inline(always)]
pub fn _0(self) -> &'a mut W {
self.variant(FHHIE_A::_0)
}
#[doc = "FHH Interrupt is Enabled"]
#[inline(always)]
pub fn _1(self) -> &'a mut W {
self.variant(FHHIE_A::_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "Frequency Lower than Low Frequency Reference Threshold Asynchronous Event Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FLLAEE_A {
#[doc = "0: Asynchronous FLL Event is Disabled"]
_0 = 0,
#[doc = "1: Asynchronous FLL Event is Enabled"]
_1 = 1,
}
impl From<FLLAEE_A> for bool {
#[inline(always)]
fn from(variant: FLLAEE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `FLLAEE`"]
pub type FLLAEE_R = crate::R<bool, FLLAEE_A>;
impl FLLAEE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FLLAEE_A {
match self.bits {
false => FLLAEE_A::_0,
true => FLLAEE_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == FLLAEE_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == FLLAEE_A::_1
}
}
#[doc = "Write proxy for field `FLLAEE`"]
pub struct FLLAEE_W<'a> {
w: &'a mut W,
}
impl<'a> FLLAEE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FLLAEE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Asynchronous FLL Event is Disabled"]
#[inline(always)]
pub fn _0(self) -> &'a mut W {
self.variant(FLLAEE_A::_0)
}
#[doc = "Asynchronous FLL Event is Enabled"]
#[inline(always)]
pub fn _1(self) -> &'a mut W {
self.variant(FLLAEE_A::_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
self.w
}
}
#[doc = "Frequency Higher than High Frequency Reference Threshold Asynchronous Event Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FHHAEE_A {
#[doc = "0: Asynchronous FHH Event is Disabled"]
_0 = 0,
#[doc = "1: Asynchronous FHH Event is Enabled"]
_1 = 1,
}
impl From<FHHAEE_A> for bool {
#[inline(always)]
fn from(variant: FHHAEE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `FHHAEE`"]
pub type FHHAEE_R = crate::R<bool, FHHAEE_A>;
impl FHHAEE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> FHHAEE_A {
match self.bits {
false => FHHAEE_A::_0,
true => FHHAEE_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == FHHAEE_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == FHHAEE_A::_1
}
}
#[doc = "Write proxy for field `FHHAEE`"]
pub struct FHHAEE_W<'a> {
w: &'a mut W,
}
impl<'a> FHHAEE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FHHAEE_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Asynchronous FHH Event is Disabled"]
#[inline(always)]
pub fn _0(self) -> &'a mut W {
self.variant(FHHAEE_A::_0)
}
#[doc = "Asynchronous FHH Event is Enabled"]
#[inline(always)]
pub fn _1(self) -> &'a mut W {
self.variant(FHHAEE_A::_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
self.w
}
}
impl R {
#[doc = "Bit 0 - Frequency Lower than Low Frequency Reference Threshold Interrupt Enable"]
#[inline(always)]
pub fn fllie(&self) -> FLLIE_R {
FLLIE_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Frequency Higher than High Frequency Reference Threshold Interrupt Enable"]
#[inline(always)]
pub fn fhhie(&self) -> FHHIE_R {
FHHIE_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Frequency Lower than Low Frequency Reference Threshold Asynchronous Event Enable"]
#[inline(always)]
pub fn fllaee(&self) -> FLLAEE_R {
FLLAEE_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Frequency Higher than High Frequency Reference Threshold Asynchronous Event Enable"]
#[inline(always)]
pub fn fhhaee(&self) -> FHHAEE_R {
FHHAEE_R::new(((self.bits >> 3) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 0 - Frequency Lower than Low Frequency Reference Threshold Interrupt Enable"]
#[inline(always)]
pub fn fllie(&mut self) -> FLLIE_W {
FLLIE_W { w: self }
}
#[doc = "Bit 1 - Frequency Higher than High Frequency Reference Threshold Interrupt Enable"]
#[inline(always)]
pub fn fhhie(&mut self) -> FHHIE_W {
FHHIE_W { w: self }
}
#[doc = "Bit 2 - Frequency Lower than Low Frequency Reference Threshold Asynchronous Event Enable"]
#[inline(always)]
pub fn fllaee(&mut self) -> FLLAEE_W {
FLLAEE_W { w: self }
}
#[doc = "Bit 3 - Frequency Higher than High Frequency Reference Threshold Asynchronous Event Enable"]
#[inline(always)]
pub fn fhhaee(&mut self) -> FHHAEE_W {
FHHAEE_W { w: self }
}
}