#[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::CR {
#[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 = "Possible values of the field `COE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COER {
#[doc = "Calibration output disabled"]
DISABLED,
#[doc = "Calibration output enabled"]
ENABLED,
}
impl COER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
COER::DISABLED => false,
COER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> COER {
match value {
false => COER::DISABLED,
true => COER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == COER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == COER::ENABLED
}
}
#[doc = "Values that can be written to the field `COE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COEW {
#[doc = "Calibration output disabled"]
DISABLED,
#[doc = "Calibration output enabled"]
ENABLED,
}
impl COEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
COEW::DISABLED => false,
COEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _COEW<'a> {
w: &'a mut W,
}
impl<'a> _COEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: COEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Calibration output disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(COEW::DISABLED)
}
#[doc = "Calibration output enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(COEW::ENABLED)
}
#[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 << 23);
self.w.bits |= ((value as u32) & 0x01) << 23;
self.w
}
}
#[doc = "Possible values of the field `OSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OSELR {
#[doc = "Output disabled"]
DISABLED,
#[doc = "Alarm A output enabled"]
ALARMA,
#[doc = "Alarm B output enabled"]
ALARMB,
#[doc = "Wakeup output enabled"]
WAKEUP,
}
impl OSELR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
OSELR::DISABLED => 0,
OSELR::ALARMA => 0x01,
OSELR::ALARMB => 0x02,
OSELR::WAKEUP => 0x03,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: u8) -> OSELR {
match value {
0 => OSELR::DISABLED,
1 => OSELR::ALARMA,
2 => OSELR::ALARMB,
3 => OSELR::WAKEUP,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == OSELR::DISABLED
}
#[doc = "Checks if the value of the field is `ALARMA`"]
#[inline(always)]
pub fn is_alarm_a(&self) -> bool {
*self == OSELR::ALARMA
}
#[doc = "Checks if the value of the field is `ALARMB`"]
#[inline(always)]
pub fn is_alarm_b(&self) -> bool {
*self == OSELR::ALARMB
}
#[doc = "Checks if the value of the field is `WAKEUP`"]
#[inline(always)]
pub fn is_wakeup(&self) -> bool {
*self == OSELR::WAKEUP
}
}
#[doc = "Values that can be written to the field `OSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OSELW {
#[doc = "Output disabled"]
DISABLED,
#[doc = "Alarm A output enabled"]
ALARMA,
#[doc = "Alarm B output enabled"]
ALARMB,
#[doc = "Wakeup output enabled"]
WAKEUP,
}
impl OSELW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> u8 {
match *self {
OSELW::DISABLED => 0,
OSELW::ALARMA => 1,
OSELW::ALARMB => 2,
OSELW::WAKEUP => 3,
}
}
}
#[doc = r"Proxy"]
pub struct _OSELW<'a> {
w: &'a mut W,
}
impl<'a> _OSELW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: OSELW) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Output disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(OSELW::DISABLED)
}
#[doc = "Alarm A output enabled"]
#[inline(always)]
pub fn alarm_a(self) -> &'a mut W {
self.variant(OSELW::ALARMA)
}
#[doc = "Alarm B output enabled"]
#[inline(always)]
pub fn alarm_b(self) -> &'a mut W {
self.variant(OSELW::ALARMB)
}
#[doc = "Wakeup output enabled"]
#[inline(always)]
pub fn wakeup(self) -> &'a mut W {
self.variant(OSELW::WAKEUP)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x03 << 21);
self.w.bits |= ((value as u32) & 0x03) << 21;
self.w
}
}
#[doc = "Possible values of the field `POL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum POLR {
#[doc = "The pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL\\[1:0\\])"]
HIGH,
#[doc = "The pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL\\[1:0\\])"]
LOW,
}
impl POLR {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
POLR::HIGH => false,
POLR::LOW => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> POLR {
match value {
false => POLR::HIGH,
true => POLR::LOW,
}
}
#[doc = "Checks if the value of the field is `HIGH`"]
#[inline(always)]
pub fn is_high(&self) -> bool {
*self == POLR::HIGH
}
#[doc = "Checks if the value of the field is `LOW`"]
#[inline(always)]
pub fn is_low(&self) -> bool {
*self == POLR::LOW
}
}
#[doc = "Values that can be written to the field `POL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum POLW {
#[doc = "The pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL\\[1:0\\])"]
HIGH,
#[doc = "The pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL\\[1:0\\])"]
LOW,
}
impl POLW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
POLW::HIGH => false,
POLW::LOW => true,
}
}
}
#[doc = r"Proxy"]
pub struct _POLW<'a> {
w: &'a mut W,
}
impl<'a> _POLW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: POLW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "The pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL\\[1:0\\])"]
#[inline(always)]
pub fn high(self) -> &'a mut W {
self.variant(POLW::HIGH)
}
#[doc = "The pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL\\[1:0\\])"]
#[inline(always)]
pub fn low(self) -> &'a mut W {
self.variant(POLW::LOW)
}
#[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 << 20);
self.w.bits |= ((value as u32) & 0x01) << 20;
self.w
}
}
#[doc = "Possible values of the field `COSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COSELR {
#[doc = "Calibration output is 512 Hz (with default prescaler setting)"]
CALFREQ_512HZ,
#[doc = "Calibration output is 1 Hz (with default prescaler setting)"]
CALFREQ_1HZ,
}
impl COSELR {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
COSELR::CALFREQ_512HZ => false,
COSELR::CALFREQ_1HZ => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> COSELR {
match value {
false => COSELR::CALFREQ_512HZ,
true => COSELR::CALFREQ_1HZ,
}
}
#[doc = "Checks if the value of the field is `CALFREQ_512HZ`"]
#[inline(always)]
pub fn is_cal_freq_512hz(&self) -> bool {
*self == COSELR::CALFREQ_512HZ
}
#[doc = "Checks if the value of the field is `CALFREQ_1HZ`"]
#[inline(always)]
pub fn is_cal_freq_1hz(&self) -> bool {
*self == COSELR::CALFREQ_1HZ
}
}
#[doc = "Values that can be written to the field `COSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COSELW {
#[doc = "Calibration output is 512 Hz (with default prescaler setting)"]
CALFREQ_512HZ,
#[doc = "Calibration output is 1 Hz (with default prescaler setting)"]
CALFREQ_1HZ,
}
impl COSELW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
COSELW::CALFREQ_512HZ => false,
COSELW::CALFREQ_1HZ => true,
}
}
}
#[doc = r"Proxy"]
pub struct _COSELW<'a> {
w: &'a mut W,
}
impl<'a> _COSELW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: COSELW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Calibration output is 512 Hz (with default prescaler setting)"]
#[inline(always)]
pub fn cal_freq_512hz(self) -> &'a mut W {
self.variant(COSELW::CALFREQ_512HZ)
}
#[doc = "Calibration output is 1 Hz (with default prescaler setting)"]
#[inline(always)]
pub fn cal_freq_1hz(self) -> &'a mut W {
self.variant(COSELW::CALFREQ_1HZ)
}
#[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 << 19);
self.w.bits |= ((value as u32) & 0x01) << 19;
self.w
}
}
#[doc = "Possible values of the field `BKP`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BKPR {
#[doc = "Daylight Saving Time change has not been performed"]
DST_NOT_CHANGED,
#[doc = "Daylight Saving Time change has been performed"]
DST_CHANGED,
}
impl BKPR {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
BKPR::DST_NOT_CHANGED => false,
BKPR::DST_CHANGED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> BKPR {
match value {
false => BKPR::DST_NOT_CHANGED,
true => BKPR::DST_CHANGED,
}
}
#[doc = "Checks if the value of the field is `DST_NOT_CHANGED`"]
#[inline(always)]
pub fn is_dst_not_changed(&self) -> bool {
*self == BKPR::DST_NOT_CHANGED
}
#[doc = "Checks if the value of the field is `DST_CHANGED`"]
#[inline(always)]
pub fn is_dst_changed(&self) -> bool {
*self == BKPR::DST_CHANGED
}
}
#[doc = "Values that can be written to the field `BKP`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BKPW {
#[doc = "Daylight Saving Time change has not been performed"]
DST_NOT_CHANGED,
#[doc = "Daylight Saving Time change has been performed"]
DST_CHANGED,
}
impl BKPW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
BKPW::DST_NOT_CHANGED => false,
BKPW::DST_CHANGED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _BKPW<'a> {
w: &'a mut W,
}
impl<'a> _BKPW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: BKPW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Daylight Saving Time change has not been performed"]
#[inline(always)]
pub fn dst_not_changed(self) -> &'a mut W {
self.variant(BKPW::DST_NOT_CHANGED)
}
#[doc = "Daylight Saving Time change has been performed"]
#[inline(always)]
pub fn dst_changed(self) -> &'a mut W {
self.variant(BKPW::DST_CHANGED)
}
#[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 << 18);
self.w.bits |= ((value as u32) & 0x01) << 18;
self.w
}
}
#[doc = "Values that can be written to the field `SUB1H`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SUB1HW {
#[doc = "Subtracts 1 hour to the current time. This can be used for winter time change outside initialization mode"]
SUB1,
}
impl SUB1HW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
SUB1HW::SUB1 => true,
}
}
}
#[doc = r"Proxy"]
pub struct _SUB1HW<'a> {
w: &'a mut W,
}
impl<'a> _SUB1HW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SUB1HW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Subtracts 1 hour to the current time. This can be used for winter time change outside initialization mode"]
#[inline(always)]
pub fn sub1(self) -> &'a mut W {
self.variant(SUB1HW::SUB1)
}
#[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 = "Values that can be written to the field `ADD1H`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ADD1HW {
#[doc = "Adds 1 hour to the current time. This can be used for summer time change outside initialization mode"]
ADD1,
}
impl ADD1HW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ADD1HW::ADD1 => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ADD1HW<'a> {
w: &'a mut W,
}
impl<'a> _ADD1HW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ADD1HW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Adds 1 hour to the current time. This can be used for summer time change outside initialization mode"]
#[inline(always)]
pub fn add1(self) -> &'a mut W {
self.variant(ADD1HW::ADD1)
}
#[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 = "Possible values of the field `TSIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSIER {
#[doc = "Time-stamp Interrupt disabled"]
DISABLED,
#[doc = "Time-stamp Interrupt enabled"]
ENABLED,
}
impl TSIER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
TSIER::DISABLED => false,
TSIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TSIER {
match value {
false => TSIER::DISABLED,
true => TSIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TSIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TSIER::ENABLED
}
}
#[doc = "Values that can be written to the field `TSIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSIEW {
#[doc = "Time-stamp Interrupt disabled"]
DISABLED,
#[doc = "Time-stamp Interrupt enabled"]
ENABLED,
}
impl TSIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TSIEW::DISABLED => false,
TSIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TSIEW<'a> {
w: &'a mut W,
}
impl<'a> _TSIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TSIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Time-stamp Interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TSIEW::DISABLED)
}
#[doc = "Time-stamp Interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TSIEW::ENABLED)
}
#[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 << 15);
self.w.bits |= ((value as u32) & 0x01) << 15;
self.w
}
}
#[doc = "Possible values of the field `WUTIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUTIER {
#[doc = "Wakeup timer interrupt disabled"]
DISABLED,
#[doc = "Wakeup timer interrupt enabled"]
ENABLED,
}
impl WUTIER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
WUTIER::DISABLED => false,
WUTIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> WUTIER {
match value {
false => WUTIER::DISABLED,
true => WUTIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WUTIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WUTIER::ENABLED
}
}
#[doc = "Values that can be written to the field `WUTIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUTIEW {
#[doc = "Wakeup timer interrupt disabled"]
DISABLED,
#[doc = "Wakeup timer interrupt enabled"]
ENABLED,
}
impl WUTIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
WUTIEW::DISABLED => false,
WUTIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _WUTIEW<'a> {
w: &'a mut W,
}
impl<'a> _WUTIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WUTIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Wakeup timer interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(WUTIEW::DISABLED)
}
#[doc = "Wakeup timer interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(WUTIEW::ENABLED)
}
#[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 = "Possible values of the field `ALRBIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRBIER {
#[doc = "Alarm B Interrupt disabled"]
DISABLED,
#[doc = "Alarm B Interrupt enabled"]
ENABLED,
}
impl ALRBIER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
ALRBIER::DISABLED => false,
ALRBIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ALRBIER {
match value {
false => ALRBIER::DISABLED,
true => ALRBIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALRBIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALRBIER::ENABLED
}
}
#[doc = "Values that can be written to the field `ALRBIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRBIEW {
#[doc = "Alarm B Interrupt disabled"]
DISABLED,
#[doc = "Alarm B Interrupt enabled"]
ENABLED,
}
impl ALRBIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ALRBIEW::DISABLED => false,
ALRBIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ALRBIEW<'a> {
w: &'a mut W,
}
impl<'a> _ALRBIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ALRBIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Alarm B Interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ALRBIEW::DISABLED)
}
#[doc = "Alarm B Interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ALRBIEW::ENABLED)
}
#[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 << 13);
self.w.bits |= ((value as u32) & 0x01) << 13;
self.w
}
}
#[doc = "Possible values of the field `ALRAIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRAIER {
#[doc = "Alarm A interrupt disabled"]
DISABLED,
#[doc = "Alarm A interrupt enabled"]
ENABLED,
}
impl ALRAIER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
ALRAIER::DISABLED => false,
ALRAIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ALRAIER {
match value {
false => ALRAIER::DISABLED,
true => ALRAIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALRAIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALRAIER::ENABLED
}
}
#[doc = "Values that can be written to the field `ALRAIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRAIEW {
#[doc = "Alarm A interrupt disabled"]
DISABLED,
#[doc = "Alarm A interrupt enabled"]
ENABLED,
}
impl ALRAIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ALRAIEW::DISABLED => false,
ALRAIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ALRAIEW<'a> {
w: &'a mut W,
}
impl<'a> _ALRAIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ALRAIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Alarm A interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ALRAIEW::DISABLED)
}
#[doc = "Alarm A interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ALRAIEW::ENABLED)
}
#[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 << 12);
self.w.bits |= ((value as u32) & 0x01) << 12;
self.w
}
}
#[doc = "Possible values of the field `TSE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSER {
#[doc = "Timestamp disabled"]
DISABLED,
#[doc = "Timestamp enabled"]
ENABLED,
}
impl TSER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
TSER::DISABLED => false,
TSER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TSER {
match value {
false => TSER::DISABLED,
true => TSER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TSER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TSER::ENABLED
}
}
#[doc = "Values that can be written to the field `TSE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSEW {
#[doc = "Timestamp disabled"]
DISABLED,
#[doc = "Timestamp enabled"]
ENABLED,
}
impl TSEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TSEW::DISABLED => false,
TSEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TSEW<'a> {
w: &'a mut W,
}
impl<'a> _TSEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TSEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Timestamp disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TSEW::DISABLED)
}
#[doc = "Timestamp enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TSEW::ENABLED)
}
#[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 << 11);
self.w.bits |= ((value as u32) & 0x01) << 11;
self.w
}
}
#[doc = "Possible values of the field `WUTE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUTER {
#[doc = "Wakeup timer disabled"]
DISABLED,
#[doc = "Wakeup timer enabled"]
ENABLED,
}
impl WUTER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
WUTER::DISABLED => false,
WUTER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> WUTER {
match value {
false => WUTER::DISABLED,
true => WUTER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WUTER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WUTER::ENABLED
}
}
#[doc = "Values that can be written to the field `WUTE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUTEW {
#[doc = "Wakeup timer disabled"]
DISABLED,
#[doc = "Wakeup timer enabled"]
ENABLED,
}
impl WUTEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
WUTEW::DISABLED => false,
WUTEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _WUTEW<'a> {
w: &'a mut W,
}
impl<'a> _WUTEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WUTEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Wakeup timer disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(WUTEW::DISABLED)
}
#[doc = "Wakeup timer enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(WUTEW::ENABLED)
}
#[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 << 10);
self.w.bits |= ((value as u32) & 0x01) << 10;
self.w
}
}
#[doc = "Possible values of the field `ALRBE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRBER {
#[doc = "Alarm B disabled"]
DISABLED,
#[doc = "Alarm B enabled"]
ENABLED,
}
impl ALRBER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
ALRBER::DISABLED => false,
ALRBER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ALRBER {
match value {
false => ALRBER::DISABLED,
true => ALRBER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALRBER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALRBER::ENABLED
}
}
#[doc = "Values that can be written to the field `ALRBE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRBEW {
#[doc = "Alarm B disabled"]
DISABLED,
#[doc = "Alarm B enabled"]
ENABLED,
}
impl ALRBEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ALRBEW::DISABLED => false,
ALRBEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ALRBEW<'a> {
w: &'a mut W,
}
impl<'a> _ALRBEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ALRBEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Alarm B disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ALRBEW::DISABLED)
}
#[doc = "Alarm B enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ALRBEW::ENABLED)
}
#[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 = "Possible values of the field `ALRAE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRAER {
#[doc = "Alarm A disabled"]
DISABLED,
#[doc = "Alarm A enabled"]
ENABLED,
}
impl ALRAER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
ALRAER::DISABLED => false,
ALRAER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ALRAER {
match value {
false => ALRAER::DISABLED,
true => ALRAER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALRAER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALRAER::ENABLED
}
}
#[doc = "Values that can be written to the field `ALRAE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ALRAEW {
#[doc = "Alarm A disabled"]
DISABLED,
#[doc = "Alarm A enabled"]
ENABLED,
}
impl ALRAEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ALRAEW::DISABLED => false,
ALRAEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ALRAEW<'a> {
w: &'a mut W,
}
impl<'a> _ALRAEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ALRAEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Alarm A disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ALRAEW::DISABLED)
}
#[doc = "Alarm A enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ALRAEW::ENABLED)
}
#[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
}
}
#[doc = "Possible values of the field `FMT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FMTR {
#[doc = "24 hour/day format"]
TWENTY_FOUR_HOUR,
#[doc = "AM/PM hour format"]
AM_PM,
}
impl FMTR {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
FMTR::TWENTY_FOUR_HOUR => false,
FMTR::AM_PM => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> FMTR {
match value {
false => FMTR::TWENTY_FOUR_HOUR,
true => FMTR::AM_PM,
}
}
#[doc = "Checks if the value of the field is `TWENTY_FOUR_HOUR`"]
#[inline(always)]
pub fn is_twenty_four_hour(&self) -> bool {
*self == FMTR::TWENTY_FOUR_HOUR
}
#[doc = "Checks if the value of the field is `AM_PM`"]
#[inline(always)]
pub fn is_am_pm(&self) -> bool {
*self == FMTR::AM_PM
}
}
#[doc = "Values that can be written to the field `FMT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FMTW {
#[doc = "24 hour/day format"]
TWENTY_FOUR_HOUR,
#[doc = "AM/PM hour format"]
AM_PM,
}
impl FMTW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
FMTW::TWENTY_FOUR_HOUR => false,
FMTW::AM_PM => true,
}
}
}
#[doc = r"Proxy"]
pub struct _FMTW<'a> {
w: &'a mut W,
}
impl<'a> _FMTW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: FMTW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "24 hour/day format"]
#[inline(always)]
pub fn twenty_four_hour(self) -> &'a mut W {
self.variant(FMTW::TWENTY_FOUR_HOUR)
}
#[doc = "AM/PM hour format"]
#[inline(always)]
pub fn am_pm(self) -> &'a mut W {
self.variant(FMTW::AM_PM)
}
#[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 << 6);
self.w.bits |= ((value as u32) & 0x01) << 6;
self.w
}
}
#[doc = "Possible values of the field `BYPSHAD`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BYPSHADR {
#[doc = "Calendar values (when reading from RTC_SSR, RTC_TR, and RTC_DR) are taken from the shadow registers, which are updated once every two RTCCLK cycles"]
SHADOWREG,
#[doc = "Calendar values (when reading from RTC_SSR, RTC_TR, and RTC_DR) are taken directly from the calendar counters"]
BYPASSSHADOWREG,
}
impl BYPSHADR {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
BYPSHADR::SHADOWREG => false,
BYPSHADR::BYPASSSHADOWREG => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> BYPSHADR {
match value {
false => BYPSHADR::SHADOWREG,
true => BYPSHADR::BYPASSSHADOWREG,
}
}
#[doc = "Checks if the value of the field is `SHADOWREG`"]
#[inline(always)]
pub fn is_shadow_reg(&self) -> bool {
*self == BYPSHADR::SHADOWREG
}
#[doc = "Checks if the value of the field is `BYPASSSHADOWREG`"]
#[inline(always)]
pub fn is_bypass_shadow_reg(&self) -> bool {
*self == BYPSHADR::BYPASSSHADOWREG
}
}
#[doc = "Values that can be written to the field `BYPSHAD`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BYPSHADW {
#[doc = "Calendar values (when reading from RTC_SSR, RTC_TR, and RTC_DR) are taken from the shadow registers, which are updated once every two RTCCLK cycles"]
SHADOWREG,
#[doc = "Calendar values (when reading from RTC_SSR, RTC_TR, and RTC_DR) are taken directly from the calendar counters"]
BYPASSSHADOWREG,
}
impl BYPSHADW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
BYPSHADW::SHADOWREG => false,
BYPSHADW::BYPASSSHADOWREG => true,
}
}
}
#[doc = r"Proxy"]
pub struct _BYPSHADW<'a> {
w: &'a mut W,
}
impl<'a> _BYPSHADW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: BYPSHADW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Calendar values (when reading from RTC_SSR, RTC_TR, and RTC_DR) are taken from the shadow registers, which are updated once every two RTCCLK cycles"]
#[inline(always)]
pub fn shadow_reg(self) -> &'a mut W {
self.variant(BYPSHADW::SHADOWREG)
}
#[doc = "Calendar values (when reading from RTC_SSR, RTC_TR, and RTC_DR) are taken directly from the calendar counters"]
#[inline(always)]
pub fn bypass_shadow_reg(self) -> &'a mut W {
self.variant(BYPSHADW::BYPASSSHADOWREG)
}
#[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 << 5);
self.w.bits |= ((value as u32) & 0x01) << 5;
self.w
}
}
#[doc = "Possible values of the field `REFCKON`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REFCKONR {
#[doc = "RTC_REFIN detection disabled"]
DISABLED,
#[doc = "RTC_REFIN detection enabled"]
ENABLED,
}
impl REFCKONR {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
REFCKONR::DISABLED => false,
REFCKONR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> REFCKONR {
match value {
false => REFCKONR::DISABLED,
true => REFCKONR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == REFCKONR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REFCKONR::ENABLED
}
}
#[doc = "Values that can be written to the field `REFCKON`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REFCKONW {
#[doc = "RTC_REFIN detection disabled"]
DISABLED,
#[doc = "RTC_REFIN detection enabled"]
ENABLED,
}
impl REFCKONW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
REFCKONW::DISABLED => false,
REFCKONW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _REFCKONW<'a> {
w: &'a mut W,
}
impl<'a> _REFCKONW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: REFCKONW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "RTC_REFIN detection disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(REFCKONW::DISABLED)
}
#[doc = "RTC_REFIN detection enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(REFCKONW::ENABLED)
}
#[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 << 4);
self.w.bits |= ((value as u32) & 0x01) << 4;
self.w
}
}
#[doc = "Possible values of the field `TSEDGE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSEDGER {
#[doc = "RTC_TS input rising edge generates a time-stamp event"]
RISINGEDGE,
#[doc = "RTC_TS input falling edge generates a time-stamp event"]
FALLINGEDGE,
}
impl TSEDGER {
#[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 as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
TSEDGER::RISINGEDGE => false,
TSEDGER::FALLINGEDGE => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TSEDGER {
match value {
false => TSEDGER::RISINGEDGE,
true => TSEDGER::FALLINGEDGE,
}
}
#[doc = "Checks if the value of the field is `RISINGEDGE`"]
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == TSEDGER::RISINGEDGE
}
#[doc = "Checks if the value of the field is `FALLINGEDGE`"]
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == TSEDGER::FALLINGEDGE
}
}
#[doc = "Values that can be written to the field `TSEDGE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSEDGEW {
#[doc = "RTC_TS input rising edge generates a time-stamp event"]
RISINGEDGE,
#[doc = "RTC_TS input falling edge generates a time-stamp event"]
FALLINGEDGE,
}
impl TSEDGEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TSEDGEW::RISINGEDGE => false,
TSEDGEW::FALLINGEDGE => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TSEDGEW<'a> {
w: &'a mut W,
}
impl<'a> _TSEDGEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TSEDGEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "RTC_TS input rising edge generates a time-stamp event"]
#[inline(always)]
pub fn rising_edge(self) -> &'a mut W {
self.variant(TSEDGEW::RISINGEDGE)
}
#[doc = "RTC_TS input falling edge generates a time-stamp event"]
#[inline(always)]
pub fn falling_edge(self) -> &'a mut W {
self.variant(TSEDGEW::FALLINGEDGE)
}
#[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 << 3);
self.w.bits |= ((value as u32) & 0x01) << 3;
self.w
}
}
#[doc = "Possible values of the field `WUCKSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUCKSELR {
#[doc = "RTC/16 clock is selected"]
DIV16,
#[doc = "RTC/8 clock is selected"]
DIV8,
#[doc = "RTC/4 clock is selected"]
DIV4,
#[doc = "RTC/2 clock is selected"]
DIV2,
#[doc = "ck_spre (usually 1 Hz) clock is selected"]
CLOCKSPARE,
#[doc = "ck_spre (usually 1 Hz) clock is selected and 216 is added to the WUT counter value"]
CLOCKSPAREWITHOFFSET,
#[doc = r"Reserved"]
_Reserved(u8),
}
impl WUCKSELR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
WUCKSELR::DIV16 => 0,
WUCKSELR::DIV8 => 0x01,
WUCKSELR::DIV4 => 0x02,
WUCKSELR::DIV2 => 0x03,
WUCKSELR::CLOCKSPARE => 0x04,
WUCKSELR::CLOCKSPAREWITHOFFSET => 0x06,
WUCKSELR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: u8) -> WUCKSELR {
match value {
0 => WUCKSELR::DIV16,
1 => WUCKSELR::DIV8,
2 => WUCKSELR::DIV4,
3 => WUCKSELR::DIV2,
4 => WUCKSELR::CLOCKSPARE,
6 => WUCKSELR::CLOCKSPAREWITHOFFSET,
i => WUCKSELR::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `DIV16`"]
#[inline(always)]
pub fn is_div16(&self) -> bool {
*self == WUCKSELR::DIV16
}
#[doc = "Checks if the value of the field is `DIV8`"]
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == WUCKSELR::DIV8
}
#[doc = "Checks if the value of the field is `DIV4`"]
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == WUCKSELR::DIV4
}
#[doc = "Checks if the value of the field is `DIV2`"]
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == WUCKSELR::DIV2
}
#[doc = "Checks if the value of the field is `CLOCKSPARE`"]
#[inline(always)]
pub fn is_clock_spare(&self) -> bool {
*self == WUCKSELR::CLOCKSPARE
}
#[doc = "Checks if the value of the field is `CLOCKSPAREWITHOFFSET`"]
#[inline(always)]
pub fn is_clock_spare_with_offset(&self) -> bool {
*self == WUCKSELR::CLOCKSPAREWITHOFFSET
}
}
#[doc = "Values that can be written to the field `WUCKSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WUCKSELW {
#[doc = "RTC/16 clock is selected"]
DIV16,
#[doc = "RTC/8 clock is selected"]
DIV8,
#[doc = "RTC/4 clock is selected"]
DIV4,
#[doc = "RTC/2 clock is selected"]
DIV2,
#[doc = "ck_spre (usually 1 Hz) clock is selected"]
CLOCKSPARE,
#[doc = "ck_spre (usually 1 Hz) clock is selected and 216 is added to the WUT counter value"]
CLOCKSPAREWITHOFFSET,
}
impl WUCKSELW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> u8 {
match *self {
WUCKSELW::DIV16 => 0,
WUCKSELW::DIV8 => 1,
WUCKSELW::DIV4 => 2,
WUCKSELW::DIV2 => 3,
WUCKSELW::CLOCKSPARE => 4,
WUCKSELW::CLOCKSPAREWITHOFFSET => 6,
}
}
}
#[doc = r"Proxy"]
pub struct _WUCKSELW<'a> {
w: &'a mut W,
}
impl<'a> _WUCKSELW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WUCKSELW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "RTC/16 clock is selected"]
#[inline(always)]
pub fn div16(self) -> &'a mut W {
self.variant(WUCKSELW::DIV16)
}
#[doc = "RTC/8 clock is selected"]
#[inline(always)]
pub fn div8(self) -> &'a mut W {
self.variant(WUCKSELW::DIV8)
}
#[doc = "RTC/4 clock is selected"]
#[inline(always)]
pub fn div4(self) -> &'a mut W {
self.variant(WUCKSELW::DIV4)
}
#[doc = "RTC/2 clock is selected"]
#[inline(always)]
pub fn div2(self) -> &'a mut W {
self.variant(WUCKSELW::DIV2)
}
#[doc = "ck_spre (usually 1 Hz) clock is selected"]
#[inline(always)]
pub fn clock_spare(self) -> &'a mut W {
self.variant(WUCKSELW::CLOCKSPARE)
}
#[doc = "ck_spre (usually 1 Hz) clock is selected and 216 is added to the WUT counter value"]
#[inline(always)]
pub fn clock_spare_with_offset(self) -> &'a mut W {
self.variant(WUCKSELW::CLOCKSPAREWITHOFFSET)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x07 << 0);
self.w.bits |= ((value as u32) & 0x07) << 0;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 23 - Calibration output enable"]
#[inline(always)]
pub fn coe(&self) -> COER {
COER::_from(((self.bits >> 23) & 0x01) != 0)
}
#[doc = "Bits 21:22 - Output selection"]
#[inline(always)]
pub fn osel(&self) -> OSELR {
OSELR::_from(((self.bits >> 21) & 0x03) as u8)
}
#[doc = "Bit 20 - Output polarity"]
#[inline(always)]
pub fn pol(&self) -> POLR {
POLR::_from(((self.bits >> 20) & 0x01) != 0)
}
#[doc = "Bit 19 - Calibration output selection"]
#[inline(always)]
pub fn cosel(&self) -> COSELR {
COSELR::_from(((self.bits >> 19) & 0x01) != 0)
}
#[doc = "Bit 18 - Backup"]
#[inline(always)]
pub fn bkp(&self) -> BKPR {
BKPR::_from(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 15 - Time-stamp interrupt enable"]
#[inline(always)]
pub fn tsie(&self) -> TSIER {
TSIER::_from(((self.bits >> 15) & 0x01) != 0)
}
#[doc = "Bit 14 - Wakeup timer interrupt enable"]
#[inline(always)]
pub fn wutie(&self) -> WUTIER {
WUTIER::_from(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 13 - Alarm B interrupt enable"]
#[inline(always)]
pub fn alrbie(&self) -> ALRBIER {
ALRBIER::_from(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 12 - Alarm A interrupt enable"]
#[inline(always)]
pub fn alraie(&self) -> ALRAIER {
ALRAIER::_from(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 11 - timestamp enable"]
#[inline(always)]
pub fn tse(&self) -> TSER {
TSER::_from(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 10 - Wakeup timer enable"]
#[inline(always)]
pub fn wute(&self) -> WUTER {
WUTER::_from(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 9 - Alarm B enable"]
#[inline(always)]
pub fn alrbe(&self) -> ALRBER {
ALRBER::_from(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 8 - Alarm A enable"]
#[inline(always)]
pub fn alrae(&self) -> ALRAER {
ALRAER::_from(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 6 - Hour format"]
#[inline(always)]
pub fn fmt(&self) -> FMTR {
FMTR::_from(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 5 - Bypass the shadow registers"]
#[inline(always)]
pub fn bypshad(&self) -> BYPSHADR {
BYPSHADR::_from(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 4 - RTC_REFIN reference clock detection enable (50 or 60 Hz)"]
#[inline(always)]
pub fn refckon(&self) -> REFCKONR {
REFCKONR::_from(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - Time-stamp event active edge"]
#[inline(always)]
pub fn tsedge(&self) -> TSEDGER {
TSEDGER::_from(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bits 0:2 - Wakeup clock selection"]
#[inline(always)]
pub fn wucksel(&self) -> WUCKSELR {
WUCKSELR::_from(((self.bits >> 0) & 0x07) as u8)
}
}
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 23 - Calibration output enable"]
#[inline(always)]
pub fn coe(&mut self) -> _COEW {
_COEW { w: self }
}
#[doc = "Bits 21:22 - Output selection"]
#[inline(always)]
pub fn osel(&mut self) -> _OSELW {
_OSELW { w: self }
}
#[doc = "Bit 20 - Output polarity"]
#[inline(always)]
pub fn pol(&mut self) -> _POLW {
_POLW { w: self }
}
#[doc = "Bit 19 - Calibration output selection"]
#[inline(always)]
pub fn cosel(&mut self) -> _COSELW {
_COSELW { w: self }
}
#[doc = "Bit 18 - Backup"]
#[inline(always)]
pub fn bkp(&mut self) -> _BKPW {
_BKPW { w: self }
}
#[doc = "Bit 17 - Subtract 1 hour (winter time change)"]
#[inline(always)]
pub fn sub1h(&mut self) -> _SUB1HW {
_SUB1HW { w: self }
}
#[doc = "Bit 16 - Add 1 hour (summer time change)"]
#[inline(always)]
pub fn add1h(&mut self) -> _ADD1HW {
_ADD1HW { w: self }
}
#[doc = "Bit 15 - Time-stamp interrupt enable"]
#[inline(always)]
pub fn tsie(&mut self) -> _TSIEW {
_TSIEW { w: self }
}
#[doc = "Bit 14 - Wakeup timer interrupt enable"]
#[inline(always)]
pub fn wutie(&mut self) -> _WUTIEW {
_WUTIEW { w: self }
}
#[doc = "Bit 13 - Alarm B interrupt enable"]
#[inline(always)]
pub fn alrbie(&mut self) -> _ALRBIEW {
_ALRBIEW { w: self }
}
#[doc = "Bit 12 - Alarm A interrupt enable"]
#[inline(always)]
pub fn alraie(&mut self) -> _ALRAIEW {
_ALRAIEW { w: self }
}
#[doc = "Bit 11 - timestamp enable"]
#[inline(always)]
pub fn tse(&mut self) -> _TSEW {
_TSEW { w: self }
}
#[doc = "Bit 10 - Wakeup timer enable"]
#[inline(always)]
pub fn wute(&mut self) -> _WUTEW {
_WUTEW { w: self }
}
#[doc = "Bit 9 - Alarm B enable"]
#[inline(always)]
pub fn alrbe(&mut self) -> _ALRBEW {
_ALRBEW { w: self }
}
#[doc = "Bit 8 - Alarm A enable"]
#[inline(always)]
pub fn alrae(&mut self) -> _ALRAEW {
_ALRAEW { w: self }
}
#[doc = "Bit 6 - Hour format"]
#[inline(always)]
pub fn fmt(&mut self) -> _FMTW {
_FMTW { w: self }
}
#[doc = "Bit 5 - Bypass the shadow registers"]
#[inline(always)]
pub fn bypshad(&mut self) -> _BYPSHADW {
_BYPSHADW { w: self }
}
#[doc = "Bit 4 - RTC_REFIN reference clock detection enable (50 or 60 Hz)"]
#[inline(always)]
pub fn refckon(&mut self) -> _REFCKONW {
_REFCKONW { w: self }
}
#[doc = "Bit 3 - Time-stamp event active edge"]
#[inline(always)]
pub fn tsedge(&mut self) -> _TSEDGEW {
_TSEDGEW { w: self }
}
#[doc = "Bits 0:2 - Wakeup clock selection"]
#[inline(always)]
pub fn wucksel(&mut self) -> _WUCKSELW {
_WUCKSELW { w: self }
}
}