#[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::CFGR2 {
#[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 SMPTRIGR {
bits: bool,
}
impl SMPTRIGR {
#[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 _SMPTRIGW<'a> {
w: &'a mut W,
}
impl<'a> _SMPTRIGW<'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 << 27);
self.w.bits |= ((value as u32) & 0x01) << 27;
self.w
}
}
#[doc = r"Value of the field"]
pub struct BULBR {
bits: bool,
}
impl BULBR {
#[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 _BULBW<'a> {
w: &'a mut W,
}
impl<'a> _BULBW<'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 << 26);
self.w.bits |= ((value as u32) & 0x01) << 26;
self.w
}
}
#[doc = r"Value of the field"]
pub struct SWTRIGR {
bits: bool,
}
impl SWTRIGR {
#[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 _SWTRIGW<'a> {
w: &'a mut W,
}
impl<'a> _SWTRIGW<'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 << 25);
self.w.bits |= ((value as u32) & 0x01) << 25;
self.w
}
}
#[doc = r"Value of the field"]
pub struct GCOMPR {
bits: bool,
}
impl GCOMPR {
#[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 _GCOMPW<'a> {
w: &'a mut W,
}
impl<'a> _GCOMPW<'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 ROVSMR {
bits: bool,
}
impl ROVSMR {
#[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 _ROVSMW<'a> {
w: &'a mut W,
}
impl<'a> _ROVSMW<'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 << 10);
self.w.bits |= ((value as u32) & 0x01) << 10;
self.w
}
}
#[doc = r"Value of the field"]
pub struct TROVSR {
bits: bool,
}
impl TROVSR {
#[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 _TROVSW<'a> {
w: &'a mut W,
}
impl<'a> _TROVSW<'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 OVSSR {
bits: u8,
}
impl OVSSR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _OVSSW<'a> {
w: &'a mut W,
}
impl<'a> _OVSSW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x0f << 5);
self.w.bits |= ((value as u32) & 0x0f) << 5;
self.w
}
}
#[doc = r"Value of the field"]
pub struct OVSRR {
bits: u8,
}
impl OVSRR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _OVSRW<'a> {
w: &'a mut W,
}
impl<'a> _OVSRW<'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 << 2);
self.w.bits |= ((value as u32) & 0x07) << 2;
self.w
}
}
#[doc = r"Value of the field"]
pub struct JOVSER {
bits: bool,
}
impl JOVSER {
#[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 _JOVSEW<'a> {
w: &'a mut W,
}
impl<'a> _JOVSEW<'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 ROVSER {
bits: bool,
}
impl ROVSER {
#[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 _ROVSEW<'a> {
w: &'a mut W,
}
impl<'a> _ROVSEW<'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 27 - SMPTRIG"]
#[inline(always)]
pub fn smptrig(&self) -> SMPTRIGR {
let bits = ((self.bits >> 27) & 0x01) != 0;
SMPTRIGR { bits }
}
#[doc = "Bit 26 - BULB"]
#[inline(always)]
pub fn bulb(&self) -> BULBR {
let bits = ((self.bits >> 26) & 0x01) != 0;
BULBR { bits }
}
#[doc = "Bit 25 - SWTRIG"]
#[inline(always)]
pub fn swtrig(&self) -> SWTRIGR {
let bits = ((self.bits >> 25) & 0x01) != 0;
SWTRIGR { bits }
}
#[doc = "Bit 16 - GCOMP"]
#[inline(always)]
pub fn gcomp(&self) -> GCOMPR {
let bits = ((self.bits >> 16) & 0x01) != 0;
GCOMPR { bits }
}
#[doc = "Bit 10 - EXTEN"]
#[inline(always)]
pub fn rovsm(&self) -> ROVSMR {
let bits = ((self.bits >> 10) & 0x01) != 0;
ROVSMR { bits }
}
#[doc = "Bit 9 - Triggered Regular Oversampling"]
#[inline(always)]
pub fn trovs(&self) -> TROVSR {
let bits = ((self.bits >> 9) & 0x01) != 0;
TROVSR { bits }
}
#[doc = "Bits 5:8 - ALIGN"]
#[inline(always)]
pub fn ovss(&self) -> OVSSR {
let bits = ((self.bits >> 5) & 0x0f) as u8;
OVSSR { bits }
}
#[doc = "Bits 2:4 - RES"]
#[inline(always)]
pub fn ovsr(&self) -> OVSRR {
let bits = ((self.bits >> 2) & 0x07) as u8;
OVSRR { bits }
}
#[doc = "Bit 1 - DMACFG"]
#[inline(always)]
pub fn jovse(&self) -> JOVSER {
let bits = ((self.bits >> 1) & 0x01) != 0;
JOVSER { bits }
}
#[doc = "Bit 0 - DMAEN"]
#[inline(always)]
pub fn rovse(&self) -> ROVSER {
let bits = ((self.bits >> 0) & 0x01) != 0;
ROVSER { 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 27 - SMPTRIG"]
#[inline(always)]
pub fn smptrig(&mut self) -> _SMPTRIGW {
_SMPTRIGW { w: self }
}
#[doc = "Bit 26 - BULB"]
#[inline(always)]
pub fn bulb(&mut self) -> _BULBW {
_BULBW { w: self }
}
#[doc = "Bit 25 - SWTRIG"]
#[inline(always)]
pub fn swtrig(&mut self) -> _SWTRIGW {
_SWTRIGW { w: self }
}
#[doc = "Bit 16 - GCOMP"]
#[inline(always)]
pub fn gcomp(&mut self) -> _GCOMPW {
_GCOMPW { w: self }
}
#[doc = "Bit 10 - EXTEN"]
#[inline(always)]
pub fn rovsm(&mut self) -> _ROVSMW {
_ROVSMW { w: self }
}
#[doc = "Bit 9 - Triggered Regular Oversampling"]
#[inline(always)]
pub fn trovs(&mut self) -> _TROVSW {
_TROVSW { w: self }
}
#[doc = "Bits 5:8 - ALIGN"]
#[inline(always)]
pub fn ovss(&mut self) -> _OVSSW {
_OVSSW { w: self }
}
#[doc = "Bits 2:4 - RES"]
#[inline(always)]
pub fn ovsr(&mut self) -> _OVSRW {
_OVSRW { w: self }
}
#[doc = "Bit 1 - DMACFG"]
#[inline(always)]
pub fn jovse(&mut self) -> _JOVSEW {
_JOVSEW { w: self }
}
#[doc = "Bit 0 - DMAEN"]
#[inline(always)]
pub fn rovse(&mut self) -> _ROVSEW {
_ROVSEW { w: self }
}
}