#[doc = "Reader of register IF2CRQ"]
pub type R = crate::R<u32, super::IF2CRQ>;
#[doc = "Writer for register IF2CRQ"]
pub type W = crate::W<u32, super::IF2CRQ>;
#[doc = "Register IF2CRQ `reset()`'s with value 0"]
impl crate::ResetValue for super::IF2CRQ {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `MNUM`"]
pub type MNUM_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `MNUM`"]
pub struct MNUM_W<'a> {
w: &'a mut W,
}
impl<'a> MNUM_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f);
self.w
}
}
#[doc = "Reader of field `BUSY`"]
pub type BUSY_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `BUSY`"]
pub struct BUSY_W<'a> {
w: &'a mut W,
}
impl<'a> BUSY_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 & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
self.w
}
}
impl R {
#[doc = "Bits 0:5 - Message Number"]
#[inline(always)]
pub fn mnum(&self) -> MNUM_R {
MNUM_R::new((self.bits & 0x3f) as u8)
}
#[doc = "Bit 15 - Busy Flag"]
#[inline(always)]
pub fn busy(&self) -> BUSY_R {
BUSY_R::new(((self.bits >> 15) & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 0:5 - Message Number"]
#[inline(always)]
pub fn mnum(&mut self) -> MNUM_W {
MNUM_W { w: self }
}
#[doc = "Bit 15 - Busy Flag"]
#[inline(always)]
pub fn busy(&mut self) -> BUSY_W {
BUSY_W { w: self }
}
}