#[doc = "Reader of register CPUSTAT"]
pub type R = crate::R<u32, super::CPUSTAT>;
#[doc = "Writer for register CPUSTAT"]
pub type W = crate::W<u32, super::CPUSTAT>;
#[doc = "Register CPUSTAT `reset()`'s with value 0"]
impl crate::ResetValue for super::CPUSTAT {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `RESERVED12`"]
pub type RESERVED12_R = crate::R<u32, u32>;
#[doc = "Write proxy for field `RESERVED12`"]
pub struct RESERVED12_W<'a> {
w: &'a mut W,
}
impl<'a> RESERVED12_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u32) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x000f_ffff << 12)) | (((value as u32) & 0x000f_ffff) << 12);
self.w
}
}
#[doc = "Reader of field `BUS_ERROR`"]
pub type BUS_ERROR_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `BUS_ERROR`"]
pub struct BUS_ERROR_W<'a> {
w: &'a mut W,
}
impl<'a> BUS_ERROR_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 << 11)) | (((value as u32) & 0x01) << 11);
self.w
}
}
#[doc = "Reader of field `SLEEP`"]
pub type SLEEP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SLEEP`"]
pub struct SLEEP_W<'a> {
w: &'a mut W,
}
impl<'a> SLEEP_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 << 10)) | (((value as u32) & 0x01) << 10);
self.w
}
}
#[doc = "Reader of field `WEV`"]
pub type WEV_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WEV`"]
pub struct WEV_W<'a> {
w: &'a mut W,
}
impl<'a> WEV_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 << 9)) | (((value as u32) & 0x01) << 9);
self.w
}
}
#[doc = "Reader of field `HALTED`"]
pub type HALTED_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `HALTED`"]
pub struct HALTED_W<'a> {
w: &'a mut W,
}
impl<'a> HALTED_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 << 8)) | (((value as u32) & 0x01) << 8);
self.w
}
}
#[doc = "Reader of field `RESERVED4`"]
pub type RESERVED4_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `RESERVED4`"]
pub struct RESERVED4_W<'a> {
w: &'a mut W,
}
impl<'a> RESERVED4_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 & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4);
self.w
}
}
#[doc = "Reader of field `V_FLAG`"]
pub type V_FLAG_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `V_FLAG`"]
pub struct V_FLAG_W<'a> {
w: &'a mut W,
}
impl<'a> V_FLAG_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 << 3)) | (((value as u32) & 0x01) << 3);
self.w
}
}
#[doc = "Reader of field `C_FLAG`"]
pub type C_FLAG_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `C_FLAG`"]
pub struct C_FLAG_W<'a> {
w: &'a mut W,
}
impl<'a> C_FLAG_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 << 2)) | (((value as u32) & 0x01) << 2);
self.w
}
}
#[doc = "Reader of field `N_FLAG`"]
pub type N_FLAG_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `N_FLAG`"]
pub struct N_FLAG_W<'a> {
w: &'a mut W,
}
impl<'a> N_FLAG_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 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "Reader of field `Z_FLAG`"]
pub type Z_FLAG_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `Z_FLAG`"]
pub struct Z_FLAG_W<'a> {
w: &'a mut W,
}
impl<'a> Z_FLAG_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) | ((value as u32) & 0x01);
self.w
}
}
impl R {
#[doc = "Bits 12:31 - 31:12\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn reserved12(&self) -> RESERVED12_R {
RESERVED12_R::new(((self.bits >> 12) & 0x000f_ffff) as u32)
}
#[doc = "Bit 11 - 11:11\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn bus_error(&self) -> BUS_ERROR_R {
BUS_ERROR_R::new(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 10 - 10:10\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn sleep(&self) -> SLEEP_R {
SLEEP_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 9 - 9:9\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn wev(&self) -> WEV_R {
WEV_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 8 - 8:8\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn halted(&self) -> HALTED_R {
HALTED_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bits 4:7 - 7:4\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn reserved4(&self) -> RESERVED4_R {
RESERVED4_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[doc = "Bit 3 - 3:3\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn v_flag(&self) -> V_FLAG_R {
V_FLAG_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - 2:2\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn c_flag(&self) -> C_FLAG_R {
C_FLAG_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - 1:1\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn n_flag(&self) -> N_FLAG_R {
N_FLAG_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - 0:0\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn z_flag(&self) -> Z_FLAG_R {
Z_FLAG_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 12:31 - 31:12\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn reserved12(&mut self) -> RESERVED12_W {
RESERVED12_W { w: self }
}
#[doc = "Bit 11 - 11:11\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn bus_error(&mut self) -> BUS_ERROR_W {
BUS_ERROR_W { w: self }
}
#[doc = "Bit 10 - 10:10\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn sleep(&mut self) -> SLEEP_W {
SLEEP_W { w: self }
}
#[doc = "Bit 9 - 9:9\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn wev(&mut self) -> WEV_W {
WEV_W { w: self }
}
#[doc = "Bit 8 - 8:8\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn halted(&mut self) -> HALTED_W {
HALTED_W { w: self }
}
#[doc = "Bits 4:7 - 7:4\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn reserved4(&mut self) -> RESERVED4_W {
RESERVED4_W { w: self }
}
#[doc = "Bit 3 - 3:3\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn v_flag(&mut self) -> V_FLAG_W {
V_FLAG_W { w: self }
}
#[doc = "Bit 2 - 2:2\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn c_flag(&mut self) -> C_FLAG_W {
C_FLAG_W { w: self }
}
#[doc = "Bit 1 - 1:1\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn n_flag(&mut self) -> N_FLAG_W {
N_FLAG_W { w: self }
}
#[doc = "Bit 0 - 0:0\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn z_flag(&mut self) -> Z_FLAG_W {
Z_FLAG_W { w: self }
}
}