#[doc = r"Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::CSR1 {
#[doc = r"Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
self.register.set(f(&R { bits }, &mut W { bits }).bits);
}
#[doc = r"Reads the contents of the register"]
#[inline(always)]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = r"Value of the field"]
pub struct WUIFR {
bits: bool,
}
impl WUIFR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Value of the field"]
pub struct SBFR {
bits: bool,
}
impl SBFR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Value of the field"]
pub struct PVDOR {
bits: bool,
}
impl PVDOR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Value of the field"]
pub struct BRRR {
bits: bool,
}
impl BRRR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Value of the field"]
pub struct BRER {
bits: bool,
}
impl BRER {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _BREW<'a> {
w: &'a mut W,
}
impl<'a> _BREW<'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 &= !(0x01 << 9);
self.w.bits |= ((value as u32) & 0x01) << 9;
self.w
}
}
#[doc = r"Value of the field"]
pub struct VOSRDYR {
bits: bool,
}
impl VOSRDYR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _VOSRDYW<'a> {
w: &'a mut W,
}
impl<'a> _VOSRDYW<'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 &= !(0x01 << 14);
self.w.bits |= ((value as u32) & 0x01) << 14;
self.w
}
}
#[doc = r"Value of the field"]
pub struct ODRDYR {
bits: bool,
}
impl ODRDYR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _ODRDYW<'a> {
w: &'a mut W,
}
impl<'a> _ODRDYW<'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 &= !(0x01 << 16);
self.w.bits |= ((value as u32) & 0x01) << 16;
self.w
}
}
#[doc = r"Value of the field"]
pub struct ODSWRDYR {
bits: bool,
}
impl ODSWRDYR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _ODSWRDYW<'a> {
w: &'a mut W,
}
impl<'a> _ODSWRDYW<'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 &= !(0x01 << 17);
self.w.bits |= ((value as u32) & 0x01) << 17;
self.w
}
}
#[doc = r"Value of the field"]
pub struct UDRDYR {
bits: u8,
}
impl UDRDYR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _UDRDYW<'a> {
w: &'a mut W,
}
impl<'a> _UDRDYW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x03 << 18);
self.w.bits |= ((value as u32) & 0x03) << 18;
self.w
}
}
#[doc = r"Value of the field"]
pub struct EIWUPR {
bits: bool,
}
impl EIWUPR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _EIWUPW<'a> {
w: &'a mut W,
}
impl<'a> _EIWUPW<'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 &= !(0x01 << 8);
self.w.bits |= ((value as u32) & 0x01) << 8;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 0 - Wakeup internal flag"]
#[inline(always)]
pub fn wuif(&self) -> WUIFR {
let bits = ((self.bits >> 0) & 0x01) != 0;
WUIFR { bits }
}
#[doc = "Bit 1 - Standby flag"]
#[inline(always)]
pub fn sbf(&self) -> SBFR {
let bits = ((self.bits >> 1) & 0x01) != 0;
SBFR { bits }
}
#[doc = "Bit 2 - PVD output"]
#[inline(always)]
pub fn pvdo(&self) -> PVDOR {
let bits = ((self.bits >> 2) & 0x01) != 0;
PVDOR { bits }
}
#[doc = "Bit 3 - Backup regulator ready"]
#[inline(always)]
pub fn brr(&self) -> BRRR {
let bits = ((self.bits >> 3) & 0x01) != 0;
BRRR { bits }
}
#[doc = "Bit 9 - Backup regulator enable"]
#[inline(always)]
pub fn bre(&self) -> BRER {
let bits = ((self.bits >> 9) & 0x01) != 0;
BRER { bits }
}
#[doc = "Bit 14 - Regulator voltage scaling output selection ready bit"]
#[inline(always)]
pub fn vosrdy(&self) -> VOSRDYR {
let bits = ((self.bits >> 14) & 0x01) != 0;
VOSRDYR { bits }
}
#[doc = "Bit 16 - Over-drive mode ready"]
#[inline(always)]
pub fn odrdy(&self) -> ODRDYR {
let bits = ((self.bits >> 16) & 0x01) != 0;
ODRDYR { bits }
}
#[doc = "Bit 17 - Over-drive mode switching ready"]
#[inline(always)]
pub fn odswrdy(&self) -> ODSWRDYR {
let bits = ((self.bits >> 17) & 0x01) != 0;
ODSWRDYR { bits }
}
#[doc = "Bits 18:19 - Under-drive ready flag"]
#[inline(always)]
pub fn udrdy(&self) -> UDRDYR {
let bits = ((self.bits >> 18) & 0x03) as u8;
UDRDYR { bits }
}
#[doc = "Bit 8 - Enable internal wakeup"]
#[inline(always)]
pub fn eiwup(&self) -> EIWUPR {
let bits = ((self.bits >> 8) & 0x01) != 0;
EIWUPR { bits }
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 9 - Backup regulator enable"]
#[inline(always)]
pub fn bre(&mut self) -> _BREW {
_BREW { w: self }
}
#[doc = "Bit 14 - Regulator voltage scaling output selection ready bit"]
#[inline(always)]
pub fn vosrdy(&mut self) -> _VOSRDYW {
_VOSRDYW { w: self }
}
#[doc = "Bit 16 - Over-drive mode ready"]
#[inline(always)]
pub fn odrdy(&mut self) -> _ODRDYW {
_ODRDYW { w: self }
}
#[doc = "Bit 17 - Over-drive mode switching ready"]
#[inline(always)]
pub fn odswrdy(&mut self) -> _ODSWRDYW {
_ODSWRDYW { w: self }
}
#[doc = "Bits 18:19 - Under-drive ready flag"]
#[inline(always)]
pub fn udrdy(&mut self) -> _UDRDYW {
_UDRDYW { w: self }
}
#[doc = "Bit 8 - Enable internal wakeup"]
#[inline(always)]
pub fn eiwup(&mut self) -> _EIWUPW {
_EIWUPW { w: self }
}
}