#[doc = "Register `UART_INT_ENA` reader"]
pub struct R(crate::R<UART_INT_ENA_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<UART_INT_ENA_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<UART_INT_ENA_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<UART_INT_ENA_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `UART_INT_ENA` writer"]
pub struct W(crate::W<UART_INT_ENA_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<UART_INT_ENA_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<UART_INT_ENA_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<UART_INT_ENA_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `rxfifo_tout_int_ena` reader - The interrupt enable bit for rx time-out interrupt"]
pub struct RXFIFO_TOUT_INT_ENA_R(crate::FieldReader<bool, bool>);
impl RXFIFO_TOUT_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
RXFIFO_TOUT_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RXFIFO_TOUT_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `rxfifo_tout_int_ena` writer - The interrupt enable bit for rx time-out interrupt"]
pub struct RXFIFO_TOUT_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> RXFIFO_TOUT_INT_ENA_W<'a> {
#[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 & !(1 << 8)) | ((value as u32 & 1) << 8);
self.w
}
}
#[doc = "Field `brk_det_int_ena` reader - The interrupt enable bit for rx byte start error"]
pub struct BRK_DET_INT_ENA_R(crate::FieldReader<bool, bool>);
impl BRK_DET_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
BRK_DET_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for BRK_DET_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `brk_det_int_ena` writer - The interrupt enable bit for rx byte start error"]
pub struct BRK_DET_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> BRK_DET_INT_ENA_W<'a> {
#[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 & !(1 << 7)) | ((value as u32 & 1) << 7);
self.w
}
}
#[doc = "Field `cts_chg_int_ena` reader - The interrupt enable bit for CTS changing level"]
pub struct CTS_CHG_INT_ENA_R(crate::FieldReader<bool, bool>);
impl CTS_CHG_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
CTS_CHG_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CTS_CHG_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `cts_chg_int_ena` writer - The interrupt enable bit for CTS changing level"]
pub struct CTS_CHG_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> CTS_CHG_INT_ENA_W<'a> {
#[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 & !(1 << 6)) | ((value as u32 & 1) << 6);
self.w
}
}
#[doc = "Field `dsr_chg_int_ena` reader - The interrupt enable bit for DSR changing level"]
pub struct DSR_CHG_INT_ENA_R(crate::FieldReader<bool, bool>);
impl DSR_CHG_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
DSR_CHG_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for DSR_CHG_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `dsr_chg_int_ena` writer - The interrupt enable bit for DSR changing level"]
pub struct DSR_CHG_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> DSR_CHG_INT_ENA_W<'a> {
#[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 & !(1 << 5)) | ((value as u32 & 1) << 5);
self.w
}
}
#[doc = "Field `rxfifo_ovf_int_ena` reader - The interrupt enable bit for rx fifo overflow"]
pub struct RXFIFO_OVF_INT_ENA_R(crate::FieldReader<bool, bool>);
impl RXFIFO_OVF_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
RXFIFO_OVF_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RXFIFO_OVF_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `rxfifo_ovf_int_ena` writer - The interrupt enable bit for rx fifo overflow"]
pub struct RXFIFO_OVF_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> RXFIFO_OVF_INT_ENA_W<'a> {
#[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 & !(1 << 4)) | ((value as u32 & 1) << 4);
self.w
}
}
#[doc = "Field `frm_err_int_ena` reader - The interrupt enable bit for other rx error"]
pub struct FRM_ERR_INT_ENA_R(crate::FieldReader<bool, bool>);
impl FRM_ERR_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
FRM_ERR_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FRM_ERR_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `frm_err_int_ena` writer - The interrupt enable bit for other rx error"]
pub struct FRM_ERR_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> FRM_ERR_INT_ENA_W<'a> {
#[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 & !(1 << 3)) | ((value as u32 & 1) << 3);
self.w
}
}
#[doc = "Field `parity_err_int_ena` reader - The interrupt enable bit for parity error"]
pub struct PARITY_ERR_INT_ENA_R(crate::FieldReader<bool, bool>);
impl PARITY_ERR_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
PARITY_ERR_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for PARITY_ERR_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `parity_err_int_ena` writer - The interrupt enable bit for parity error"]
pub struct PARITY_ERR_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> PARITY_ERR_INT_ENA_W<'a> {
#[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 & !(1 << 2)) | ((value as u32 & 1) << 2);
self.w
}
}
#[doc = "Field `txfifo_empty_int_ena` reader - The interrupt enable bit for tx fifo empty event"]
pub struct TXFIFO_EMPTY_INT_ENA_R(crate::FieldReader<bool, bool>);
impl TXFIFO_EMPTY_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
TXFIFO_EMPTY_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TXFIFO_EMPTY_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `txfifo_empty_int_ena` writer - The interrupt enable bit for tx fifo empty event"]
pub struct TXFIFO_EMPTY_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> TXFIFO_EMPTY_INT_ENA_W<'a> {
#[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 & !(1 << 1)) | ((value as u32 & 1) << 1);
self.w
}
}
#[doc = "Field `rxfifo_full_int_ena` reader - The interrupt enable bit for rx fifo full event"]
pub struct RXFIFO_FULL_INT_ENA_R(crate::FieldReader<bool, bool>);
impl RXFIFO_FULL_INT_ENA_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
RXFIFO_FULL_INT_ENA_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RXFIFO_FULL_INT_ENA_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `rxfifo_full_int_ena` writer - The interrupt enable bit for rx fifo full event"]
pub struct RXFIFO_FULL_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> RXFIFO_FULL_INT_ENA_W<'a> {
#[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 & !1) | (value as u32 & 1);
self.w
}
}
impl R {
#[doc = "Bit 8 - The interrupt enable bit for rx time-out interrupt"]
#[inline(always)]
pub fn rxfifo_tout_int_ena(&self) -> RXFIFO_TOUT_INT_ENA_R {
RXFIFO_TOUT_INT_ENA_R::new(((self.bits >> 8) & 1) != 0)
}
#[doc = "Bit 7 - The interrupt enable bit for rx byte start error"]
#[inline(always)]
pub fn brk_det_int_ena(&self) -> BRK_DET_INT_ENA_R {
BRK_DET_INT_ENA_R::new(((self.bits >> 7) & 1) != 0)
}
#[doc = "Bit 6 - The interrupt enable bit for CTS changing level"]
#[inline(always)]
pub fn cts_chg_int_ena(&self) -> CTS_CHG_INT_ENA_R {
CTS_CHG_INT_ENA_R::new(((self.bits >> 6) & 1) != 0)
}
#[doc = "Bit 5 - The interrupt enable bit for DSR changing level"]
#[inline(always)]
pub fn dsr_chg_int_ena(&self) -> DSR_CHG_INT_ENA_R {
DSR_CHG_INT_ENA_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bit 4 - The interrupt enable bit for rx fifo overflow"]
#[inline(always)]
pub fn rxfifo_ovf_int_ena(&self) -> RXFIFO_OVF_INT_ENA_R {
RXFIFO_OVF_INT_ENA_R::new(((self.bits >> 4) & 1) != 0)
}
#[doc = "Bit 3 - The interrupt enable bit for other rx error"]
#[inline(always)]
pub fn frm_err_int_ena(&self) -> FRM_ERR_INT_ENA_R {
FRM_ERR_INT_ENA_R::new(((self.bits >> 3) & 1) != 0)
}
#[doc = "Bit 2 - The interrupt enable bit for parity error"]
#[inline(always)]
pub fn parity_err_int_ena(&self) -> PARITY_ERR_INT_ENA_R {
PARITY_ERR_INT_ENA_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 1 - The interrupt enable bit for tx fifo empty event"]
#[inline(always)]
pub fn txfifo_empty_int_ena(&self) -> TXFIFO_EMPTY_INT_ENA_R {
TXFIFO_EMPTY_INT_ENA_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 0 - The interrupt enable bit for rx fifo full event"]
#[inline(always)]
pub fn rxfifo_full_int_ena(&self) -> RXFIFO_FULL_INT_ENA_R {
RXFIFO_FULL_INT_ENA_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 8 - The interrupt enable bit for rx time-out interrupt"]
#[inline(always)]
pub fn rxfifo_tout_int_ena(&mut self) -> RXFIFO_TOUT_INT_ENA_W {
RXFIFO_TOUT_INT_ENA_W { w: self }
}
#[doc = "Bit 7 - The interrupt enable bit for rx byte start error"]
#[inline(always)]
pub fn brk_det_int_ena(&mut self) -> BRK_DET_INT_ENA_W {
BRK_DET_INT_ENA_W { w: self }
}
#[doc = "Bit 6 - The interrupt enable bit for CTS changing level"]
#[inline(always)]
pub fn cts_chg_int_ena(&mut self) -> CTS_CHG_INT_ENA_W {
CTS_CHG_INT_ENA_W { w: self }
}
#[doc = "Bit 5 - The interrupt enable bit for DSR changing level"]
#[inline(always)]
pub fn dsr_chg_int_ena(&mut self) -> DSR_CHG_INT_ENA_W {
DSR_CHG_INT_ENA_W { w: self }
}
#[doc = "Bit 4 - The interrupt enable bit for rx fifo overflow"]
#[inline(always)]
pub fn rxfifo_ovf_int_ena(&mut self) -> RXFIFO_OVF_INT_ENA_W {
RXFIFO_OVF_INT_ENA_W { w: self }
}
#[doc = "Bit 3 - The interrupt enable bit for other rx error"]
#[inline(always)]
pub fn frm_err_int_ena(&mut self) -> FRM_ERR_INT_ENA_W {
FRM_ERR_INT_ENA_W { w: self }
}
#[doc = "Bit 2 - The interrupt enable bit for parity error"]
#[inline(always)]
pub fn parity_err_int_ena(&mut self) -> PARITY_ERR_INT_ENA_W {
PARITY_ERR_INT_ENA_W { w: self }
}
#[doc = "Bit 1 - The interrupt enable bit for tx fifo empty event"]
#[inline(always)]
pub fn txfifo_empty_int_ena(&mut self) -> TXFIFO_EMPTY_INT_ENA_W {
TXFIFO_EMPTY_INT_ENA_W { w: self }
}
#[doc = "Bit 0 - The interrupt enable bit for rx fifo full event"]
#[inline(always)]
pub fn rxfifo_full_int_ena(&mut self) -> RXFIFO_FULL_INT_ENA_W {
RXFIFO_FULL_INT_ENA_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "UART INTERRUPT ENABLE REGISTER\n\nThis register you can [`read`]
(crate::generic::Reg::read), [`write_with_zero`]
(crate::generic::Reg::write_with_zero), [`reset`]
(crate::generic::Reg::reset), [`write`]
(crate::generic::Reg::write), [`modify`]
(crate::generic::Reg::modify). See [API]
(https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [uart_int_ena]
(index.html) module"]
pub struct UART_INT_ENA_SPEC;
impl crate::RegisterSpec for UART_INT_ENA_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [uart_int_ena::R]
(R) reader structure"]
impl crate::Readable for UART_INT_ENA_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [uart_int_ena::W]
(W) writer structure"]
impl crate::Writable for UART_INT_ENA_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets UART_INT_ENA to value 0"]
impl crate::Resettable for UART_INT_ENA_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}