#[doc = "Register `iir` reader"] pub type R = crate::R; #[doc = "Interrupt ID. This indicates the highest priority pending interrupt which can be one of the following types: 0000 = modem status 0001 = no interrupt pending 0010 = THR empty 0100 = received data available 0110 = receiver line status 0111 = busy detect 1100 = character timeout The interrupt priorities are split into four levels that are detailed in Table 8 on page 97. Bit 3 indicates an interrupt can only occur when the FIFOs are enabled and used to distinguish a Character Timeout condition interrupt.\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum Iid { #[doc = "0: Modem status interrupt pending"] ModemStatus = 0, #[doc = "1: No interrupt pending"] NonePending = 1, #[doc = "2: THR empty"] ThrEmpty = 2, #[doc = "4: Received data available"] DataAvailable = 4, #[doc = "6: Receiver line status"] ReceiverLineStatus = 6, #[doc = "7: Busy detect"] BusyDetect = 7, #[doc = "12: Character timeout"] CharacterTimeout = 12, } impl From for u8 { #[inline(always)] fn from(variant: Iid) -> Self { variant as _ } } impl crate::FieldSpec for Iid { type Ux = u8; } impl crate::IsEnum for Iid {} #[doc = "Field `iid` reader - Interrupt ID. This indicates the highest priority pending interrupt which can be one of the following types: 0000 = modem status 0001 = no interrupt pending 0010 = THR empty 0100 = received data available 0110 = receiver line status 0111 = busy detect 1100 = character timeout The interrupt priorities are split into four levels that are detailed in Table 8 on page 97. Bit 3 indicates an interrupt can only occur when the FIFOs are enabled and used to distinguish a Character Timeout condition interrupt."] pub type IidR = crate::FieldReader; impl IidR { #[doc = "Get enumerated values variant"] #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { 0 => Some(Iid::ModemStatus), 1 => Some(Iid::NonePending), 2 => Some(Iid::ThrEmpty), 4 => Some(Iid::DataAvailable), 6 => Some(Iid::ReceiverLineStatus), 7 => Some(Iid::BusyDetect), 12 => Some(Iid::CharacterTimeout), _ => None, } } #[doc = "Modem status interrupt pending"] #[inline(always)] pub fn is_modem_status(&self) -> bool { *self == Iid::ModemStatus } #[doc = "No interrupt pending"] #[inline(always)] pub fn is_none_pending(&self) -> bool { *self == Iid::NonePending } #[doc = "THR empty"] #[inline(always)] pub fn is_thr_empty(&self) -> bool { *self == Iid::ThrEmpty } #[doc = "Received data available"] #[inline(always)] pub fn is_data_available(&self) -> bool { *self == Iid::DataAvailable } #[doc = "Receiver line status"] #[inline(always)] pub fn is_receiver_line_status(&self) -> bool { *self == Iid::ReceiverLineStatus } #[doc = "Busy detect"] #[inline(always)] pub fn is_busy_detect(&self) -> bool { *self == Iid::BusyDetect } #[doc = "Character timeout"] #[inline(always)] pub fn is_character_timeout(&self) -> bool { *self == Iid::CharacterTimeout } } #[doc = "FIFOs Enabled. This is used to indicate whether the FIFOs are enabled or disabled. 00 = disabled 11 = enabled\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum Fifose { #[doc = "0: FIFOs are disabled"] Disabled = 0, #[doc = "3: FIFOs are enabled"] Enabled = 3, } impl From for u8 { #[inline(always)] fn from(variant: Fifose) -> Self { variant as _ } } impl crate::FieldSpec for Fifose { type Ux = u8; } impl crate::IsEnum for Fifose {} #[doc = "Field `fifose` reader - FIFOs Enabled. This is used to indicate whether the FIFOs are enabled or disabled. 00 = disabled 11 = enabled"] pub type FifoseR = crate::FieldReader; impl FifoseR { #[doc = "Get enumerated values variant"] #[inline(always)] pub const fn variant(&self) -> Option { match self.bits { 0 => Some(Fifose::Disabled), 3 => Some(Fifose::Enabled), _ => None, } } #[doc = "FIFOs are disabled"] #[inline(always)] pub fn is_disabled(&self) -> bool { *self == Fifose::Disabled } #[doc = "FIFOs are enabled"] #[inline(always)] pub fn is_enabled(&self) -> bool { *self == Fifose::Enabled } } impl R { #[doc = "Bits 0:3 - Interrupt ID. This indicates the highest priority pending interrupt which can be one of the following types: 0000 = modem status 0001 = no interrupt pending 0010 = THR empty 0100 = received data available 0110 = receiver line status 0111 = busy detect 1100 = character timeout The interrupt priorities are split into four levels that are detailed in Table 8 on page 97. Bit 3 indicates an interrupt can only occur when the FIFOs are enabled and used to distinguish a Character Timeout condition interrupt."] #[inline(always)] pub fn iid(&self) -> IidR { IidR::new((self.bits & 0x0f) as u8) } #[doc = "Bits 6:7 - FIFOs Enabled. This is used to indicate whether the FIFOs are enabled or disabled. 00 = disabled 11 = enabled"] #[inline(always)] pub fn fifose(&self) -> FifoseR { FifoseR::new(((self.bits >> 6) & 3) as u8) } } #[doc = "Interrupt Identity Register\n\nYou can [`read`](crate::Reg::read) this register and get [`iir::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct IirSpec; impl crate::RegisterSpec for IirSpec { type Ux = u32; } #[doc = "`read()` method returns [`iir::R`](R) reader structure"] impl crate::Readable for IirSpec {} #[doc = "`reset()` method sets iir to value 0x01"] impl crate::Resettable for IirSpec { const RESET_VALUE: u32 = 0x01; }