#[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::COMP7_CSR {
#[doc = r" Modifies the contents of the register"]
#[inline]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
let r = R { bits: bits };
let mut w = W { bits: bits };
f(&r, &mut w);
self.register.set(w.bits);
}
#[doc = r" Reads the contents of the register"]
#[inline]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r" Writes to the register"]
#[inline]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
let mut w = W::reset_value();
f(&mut w);
self.register.set(w.bits);
}
#[doc = r" Writes the reset value to the register"]
#[inline]
pub fn reset(&self) {
self.write(|w| w)
}
}
#[doc = r" Value of the field"]
pub struct COMP7ENR {
bits: bool,
}
impl COMP7ENR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r" Value of the field"]
pub struct COMP7MODER {
bits: u8,
}
impl COMP7MODER {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct COMP7INSELR {
bits: u8,
}
impl COMP7INSELR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct COMP7INPSELR {
bits: bool,
}
impl COMP7INPSELR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r" Value of the field"]
pub struct COMP7_OUT_SELR {
bits: u8,
}
impl COMP7_OUT_SELR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct COMP7POLR {
bits: bool,
}
impl COMP7POLR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r" Value of the field"]
pub struct COMP7HYSTR {
bits: u8,
}
impl COMP7HYSTR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct COMP7_BLANKINGR {
bits: u8,
}
impl COMP7_BLANKINGR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct COMP7OUTR {
bits: bool,
}
impl COMP7OUTR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r" Value of the field"]
pub struct COMP7LOCKR {
bits: bool,
}
impl COMP7LOCKR {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r" Proxy"]
pub struct _COMP7ENW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7ENW<'a> {
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 0;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7MODEW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7MODEW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 2;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7INSELW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7INSELW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 7;
const OFFSET: u8 = 4;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7INPSELW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7INPSELW<'a> {
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 7;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7_OUT_SELW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7_OUT_SELW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 15;
const OFFSET: u8 = 10;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7POLW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7POLW<'a> {
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 15;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7HYSTW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7HYSTW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 16;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7_BLANKINGW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7_BLANKINGW<'a> {
#[doc = r" Writes raw bits to the field"]
#[inline]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 7;
const OFFSET: u8 = 18;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = r" Proxy"]
pub struct _COMP7LOCKW<'a> {
w: &'a mut W,
}
impl<'a> _COMP7LOCKW<'a> {
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 31;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 0 - Comparator 7 enable"]
#[inline]
pub fn comp7en(&self) -> COMP7ENR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u32) != 0
};
COMP7ENR { bits }
}
#[doc = "Bits 2:3 - Comparator 7 mode"]
#[inline]
pub fn comp7mode(&self) -> COMP7MODER {
let bits = {
const MASK: u8 = 3;
const OFFSET: u8 = 2;
((self.bits >> OFFSET) & MASK as u32) as u8
};
COMP7MODER { bits }
}
#[doc = "Bits 4:6 - Comparator 7 inverting input selection"]
#[inline]
pub fn comp7insel(&self) -> COMP7INSELR {
let bits = {
const MASK: u8 = 7;
const OFFSET: u8 = 4;
((self.bits >> OFFSET) & MASK as u32) as u8
};
COMP7INSELR { bits }
}
#[doc = "Bit 7 - Comparator 7 non inverted input selection"]
#[inline]
pub fn comp7inpsel(&self) -> COMP7INPSELR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 7;
((self.bits >> OFFSET) & MASK as u32) != 0
};
COMP7INPSELR { bits }
}
#[doc = "Bits 10:13 - Comparator 7 output selection"]
#[inline]
pub fn comp7_out_sel(&self) -> COMP7_OUT_SELR {
let bits = {
const MASK: u8 = 15;
const OFFSET: u8 = 10;
((self.bits >> OFFSET) & MASK as u32) as u8
};
COMP7_OUT_SELR { bits }
}
#[doc = "Bit 15 - Comparator 7 output polarity"]
#[inline]
pub fn comp7pol(&self) -> COMP7POLR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 15;
((self.bits >> OFFSET) & MASK as u32) != 0
};
COMP7POLR { bits }
}
#[doc = "Bits 16:17 - Comparator 7 hysteresis"]
#[inline]
pub fn comp7hyst(&self) -> COMP7HYSTR {
let bits = {
const MASK: u8 = 3;
const OFFSET: u8 = 16;
((self.bits >> OFFSET) & MASK as u32) as u8
};
COMP7HYSTR { bits }
}
#[doc = "Bits 18:20 - Comparator 7 blanking source"]
#[inline]
pub fn comp7_blanking(&self) -> COMP7_BLANKINGR {
let bits = {
const MASK: u8 = 7;
const OFFSET: u8 = 18;
((self.bits >> OFFSET) & MASK as u32) as u8
};
COMP7_BLANKINGR { bits }
}
#[doc = "Bit 30 - Comparator 7 output"]
#[inline]
pub fn comp7out(&self) -> COMP7OUTR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 30;
((self.bits >> OFFSET) & MASK as u32) != 0
};
COMP7OUTR { bits }
}
#[doc = "Bit 31 - Comparator 7 lock"]
#[inline]
pub fn comp7lock(&self) -> COMP7LOCKR {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 31;
((self.bits >> OFFSET) & MASK as u32) != 0
};
COMP7LOCKR { bits }
}
}
impl W {
#[doc = r" Reset value of the register"]
#[inline]
pub fn reset_value() -> W {
W { bits: 0 }
}
#[doc = r" Writes raw bits to the register"]
#[inline]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 0 - Comparator 7 enable"]
#[inline]
pub fn comp7en(&mut self) -> _COMP7ENW {
_COMP7ENW { w: self }
}
#[doc = "Bits 2:3 - Comparator 7 mode"]
#[inline]
pub fn comp7mode(&mut self) -> _COMP7MODEW {
_COMP7MODEW { w: self }
}
#[doc = "Bits 4:6 - Comparator 7 inverting input selection"]
#[inline]
pub fn comp7insel(&mut self) -> _COMP7INSELW {
_COMP7INSELW { w: self }
}
#[doc = "Bit 7 - Comparator 7 non inverted input selection"]
#[inline]
pub fn comp7inpsel(&mut self) -> _COMP7INPSELW {
_COMP7INPSELW { w: self }
}
#[doc = "Bits 10:13 - Comparator 7 output selection"]
#[inline]
pub fn comp7_out_sel(&mut self) -> _COMP7_OUT_SELW {
_COMP7_OUT_SELW { w: self }
}
#[doc = "Bit 15 - Comparator 7 output polarity"]
#[inline]
pub fn comp7pol(&mut self) -> _COMP7POLW {
_COMP7POLW { w: self }
}
#[doc = "Bits 16:17 - Comparator 7 hysteresis"]
#[inline]
pub fn comp7hyst(&mut self) -> _COMP7HYSTW {
_COMP7HYSTW { w: self }
}
#[doc = "Bits 18:20 - Comparator 7 blanking source"]
#[inline]
pub fn comp7_blanking(&mut self) -> _COMP7_BLANKINGW {
_COMP7_BLANKINGW { w: self }
}
#[doc = "Bit 31 - Comparator 7 lock"]
#[inline]
pub fn comp7lock(&mut self) -> _COMP7LOCKW {
_COMP7LOCKW { w: self }
}
}