#[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::TAFCR {
#[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 ALARMOUTTYPER {
bits: bool,
}
impl ALARMOUTTYPER {
#[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 _ALARMOUTTYPEW<'a> {
w: &'a mut W,
}
impl<'a> _ALARMOUTTYPEW<'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 << 18);
self.w.bits |= ((value as u32) & 0x01) << 18;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMPPUDISR {
bits: bool,
}
impl TAMPPUDISR {
#[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 _TAMPPUDISW<'a> {
w: &'a mut W,
}
impl<'a> _TAMPPUDISW<'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 << 15);
self.w.bits |= ((value as u32) & 0x01) << 15;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMPPRCHR {
bits: u8,
}
impl TAMPPRCHR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _TAMPPRCHW<'a> {
w: &'a mut W,
}
impl<'a> _TAMPPRCHW<'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 << 13);
self.w.bits |= ((value as u32) & 0x03) << 13;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMPFLTR {
bits: u8,
}
impl TAMPFLTR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _TAMPFLTW<'a> {
w: &'a mut W,
}
impl<'a> _TAMPFLTW<'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 << 11);
self.w.bits |= ((value as u32) & 0x03) << 11;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMPFREQR {
bits: u8,
}
impl TAMPFREQR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _TAMPFREQW<'a> {
w: &'a mut W,
}
impl<'a> _TAMPFREQW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x07 << 8);
self.w.bits |= ((value as u32) & 0x07) << 8;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMPTSR {
bits: bool,
}
impl TAMPTSR {
#[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 _TAMPTSW<'a> {
w: &'a mut W,
}
impl<'a> _TAMPTSW<'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 << 7);
self.w.bits |= ((value as u32) & 0x01) << 7;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMP3TRGR {
bits: bool,
}
impl TAMP3TRGR {
#[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 _TAMP3TRGW<'a> {
w: &'a mut W,
}
impl<'a> _TAMP3TRGW<'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 << 6);
self.w.bits |= ((value as u32) & 0x01) << 6;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMP3ER {
bits: bool,
}
impl TAMP3ER {
#[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 _TAMP3EW<'a> {
w: &'a mut W,
}
impl<'a> _TAMP3EW<'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 << 5);
self.w.bits |= ((value as u32) & 0x01) << 5;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMP2TRGR {
bits: bool,
}
impl TAMP2TRGR {
#[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 _TAMP2TRGW<'a> {
w: &'a mut W,
}
impl<'a> _TAMP2TRGW<'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 << 4);
self.w.bits |= ((value as u32) & 0x01) << 4;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMP2ER {
bits: bool,
}
impl TAMP2ER {
#[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 _TAMP2EW<'a> {
w: &'a mut W,
}
impl<'a> _TAMP2EW<'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 << 3);
self.w.bits |= ((value as u32) & 0x01) << 3;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMPIER {
bits: bool,
}
impl TAMPIER {
#[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 _TAMPIEW<'a> {
w: &'a mut W,
}
impl<'a> _TAMPIEW<'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 << 2);
self.w.bits |= ((value as u32) & 0x01) << 2;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMP1ETRGR {
bits: bool,
}
impl TAMP1ETRGR {
#[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 _TAMP1ETRGW<'a> {
w: &'a mut W,
}
impl<'a> _TAMP1ETRGW<'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 << 1);
self.w.bits |= ((value as u32) & 0x01) << 1;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TAMP1ER {
bits: bool,
}
impl TAMP1ER {
#[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 _TAMP1EW<'a> {
w: &'a mut W,
}
impl<'a> _TAMP1EW<'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 << 0);
self.w.bits |= ((value as u32) & 0x01) << 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 18 - AFO_ALARM output type"]
#[inline(always)]
pub fn alarmouttype(&self) -> ALARMOUTTYPER {
let bits = ((self.bits >> 18) & 0x01) != 0;
ALARMOUTTYPER { bits }
}
#[doc = "Bit 15 - TAMPER pull-up disable"]
#[inline(always)]
pub fn tamppudis(&self) -> TAMPPUDISR {
let bits = ((self.bits >> 15) & 0x01) != 0;
TAMPPUDISR { bits }
}
#[doc = "Bits 13:14 - Tamper precharge duration"]
#[inline(always)]
pub fn tampprch(&self) -> TAMPPRCHR {
let bits = ((self.bits >> 13) & 0x03) as u8;
TAMPPRCHR { bits }
}
#[doc = "Bits 11:12 - Tamper filter count"]
#[inline(always)]
pub fn tampflt(&self) -> TAMPFLTR {
let bits = ((self.bits >> 11) & 0x03) as u8;
TAMPFLTR { bits }
}
#[doc = "Bits 8:10 - Tamper sampling frequency"]
#[inline(always)]
pub fn tampfreq(&self) -> TAMPFREQR {
let bits = ((self.bits >> 8) & 0x07) as u8;
TAMPFREQR { bits }
}
#[doc = "Bit 7 - Activate timestamp on tamper detection event"]
#[inline(always)]
pub fn tampts(&self) -> TAMPTSR {
let bits = ((self.bits >> 7) & 0x01) != 0;
TAMPTSR { bits }
}
#[doc = "Bit 6 - TAMPER1 mapping"]
#[inline(always)]
pub fn tamp3trg(&self) -> TAMP3TRGR {
let bits = ((self.bits >> 6) & 0x01) != 0;
TAMP3TRGR { bits }
}
#[doc = "Bit 5 - TIMESTAMP mapping"]
#[inline(always)]
pub fn tamp3e(&self) -> TAMP3ER {
let bits = ((self.bits >> 5) & 0x01) != 0;
TAMP3ER { bits }
}
#[doc = "Bit 4 - Active level for tamper 2"]
#[inline(always)]
pub fn tamp2trg(&self) -> TAMP2TRGR {
let bits = ((self.bits >> 4) & 0x01) != 0;
TAMP2TRGR { bits }
}
#[doc = "Bit 3 - Tamper 2 detection enable"]
#[inline(always)]
pub fn tamp2e(&self) -> TAMP2ER {
let bits = ((self.bits >> 3) & 0x01) != 0;
TAMP2ER { bits }
}
#[doc = "Bit 2 - Tamper interrupt enable"]
#[inline(always)]
pub fn tampie(&self) -> TAMPIER {
let bits = ((self.bits >> 2) & 0x01) != 0;
TAMPIER { bits }
}
#[doc = "Bit 1 - Active level for tamper 1"]
#[inline(always)]
pub fn tamp1etrg(&self) -> TAMP1ETRGR {
let bits = ((self.bits >> 1) & 0x01) != 0;
TAMP1ETRGR { bits }
}
#[doc = "Bit 0 - Tamper 1 detection enable"]
#[inline(always)]
pub fn tamp1e(&self) -> TAMP1ER {
let bits = ((self.bits >> 0) & 0x01) != 0;
TAMP1ER { 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 18 - AFO_ALARM output type"]
#[inline(always)]
pub fn alarmouttype(&mut self) -> _ALARMOUTTYPEW {
_ALARMOUTTYPEW { w: self }
}
#[doc = "Bit 15 - TAMPER pull-up disable"]
#[inline(always)]
pub fn tamppudis(&mut self) -> _TAMPPUDISW {
_TAMPPUDISW { w: self }
}
#[doc = "Bits 13:14 - Tamper precharge duration"]
#[inline(always)]
pub fn tampprch(&mut self) -> _TAMPPRCHW {
_TAMPPRCHW { w: self }
}
#[doc = "Bits 11:12 - Tamper filter count"]
#[inline(always)]
pub fn tampflt(&mut self) -> _TAMPFLTW {
_TAMPFLTW { w: self }
}
#[doc = "Bits 8:10 - Tamper sampling frequency"]
#[inline(always)]
pub fn tampfreq(&mut self) -> _TAMPFREQW {
_TAMPFREQW { w: self }
}
#[doc = "Bit 7 - Activate timestamp on tamper detection event"]
#[inline(always)]
pub fn tampts(&mut self) -> _TAMPTSW {
_TAMPTSW { w: self }
}
#[doc = "Bit 6 - TAMPER1 mapping"]
#[inline(always)]
pub fn tamp3trg(&mut self) -> _TAMP3TRGW {
_TAMP3TRGW { w: self }
}
#[doc = "Bit 5 - TIMESTAMP mapping"]
#[inline(always)]
pub fn tamp3e(&mut self) -> _TAMP3EW {
_TAMP3EW { w: self }
}
#[doc = "Bit 4 - Active level for tamper 2"]
#[inline(always)]
pub fn tamp2trg(&mut self) -> _TAMP2TRGW {
_TAMP2TRGW { w: self }
}
#[doc = "Bit 3 - Tamper 2 detection enable"]
#[inline(always)]
pub fn tamp2e(&mut self) -> _TAMP2EW {
_TAMP2EW { w: self }
}
#[doc = "Bit 2 - Tamper interrupt enable"]
#[inline(always)]
pub fn tampie(&mut self) -> _TAMPIEW {
_TAMPIEW { w: self }
}
#[doc = "Bit 1 - Active level for tamper 1"]
#[inline(always)]
pub fn tamp1etrg(&mut self) -> _TAMP1ETRGW {
_TAMP1ETRGW { w: self }
}
#[doc = "Bit 0 - Tamper 1 detection enable"]
#[inline(always)]
pub fn tamp1e(&mut self) -> _TAMP1EW {
_TAMP1EW { w: self }
}
}