rust-embedded-talk/example-source/msp432p401r/src/comp_e1/cex_int.rs

779 lines
20 KiB
Rust

#[doc = r" Value read from the register"]
pub struct R {
bits: u16,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u16,
}
impl super::CEXINT {
#[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 = "Possible values of the field `CEIFG`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CEIFGR {
#[doc = "No interrupt pending"]
CEIFG_0,
#[doc = "Interrupt pending"]
CEIFG_1,
}
impl CEIFGR {
#[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 as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
CEIFGR::CEIFG_0 => false,
CEIFGR::CEIFG_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> CEIFGR {
match value {
false => CEIFGR::CEIFG_0,
true => CEIFGR::CEIFG_1,
}
}
#[doc = "Checks if the value of the field is `CEIFG_0`"]
#[inline]
pub fn is_ceifg_0(&self) -> bool {
*self == CEIFGR::CEIFG_0
}
#[doc = "Checks if the value of the field is `CEIFG_1`"]
#[inline]
pub fn is_ceifg_1(&self) -> bool {
*self == CEIFGR::CEIFG_1
}
}
#[doc = "Possible values of the field `CEIIFG`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CEIIFGR {
#[doc = "No interrupt pending"]
CEIIFG_0,
#[doc = "Interrupt pending"]
CEIIFG_1,
}
impl CEIIFGR {
#[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 as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
CEIIFGR::CEIIFG_0 => false,
CEIIFGR::CEIIFG_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> CEIIFGR {
match value {
false => CEIIFGR::CEIIFG_0,
true => CEIIFGR::CEIIFG_1,
}
}
#[doc = "Checks if the value of the field is `CEIIFG_0`"]
#[inline]
pub fn is_ceiifg_0(&self) -> bool {
*self == CEIIFGR::CEIIFG_0
}
#[doc = "Checks if the value of the field is `CEIIFG_1`"]
#[inline]
pub fn is_ceiifg_1(&self) -> bool {
*self == CEIIFGR::CEIIFG_1
}
}
#[doc = "Possible values of the field `CERDYIFG`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CERDYIFGR {
#[doc = "No interrupt pending"]
CERDYIFG_0,
#[doc = "Interrupt pending"]
CERDYIFG_1,
}
impl CERDYIFGR {
#[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 as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
CERDYIFGR::CERDYIFG_0 => false,
CERDYIFGR::CERDYIFG_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> CERDYIFGR {
match value {
false => CERDYIFGR::CERDYIFG_0,
true => CERDYIFGR::CERDYIFG_1,
}
}
#[doc = "Checks if the value of the field is `CERDYIFG_0`"]
#[inline]
pub fn is_cerdyifg_0(&self) -> bool {
*self == CERDYIFGR::CERDYIFG_0
}
#[doc = "Checks if the value of the field is `CERDYIFG_1`"]
#[inline]
pub fn is_cerdyifg_1(&self) -> bool {
*self == CERDYIFGR::CERDYIFG_1
}
}
#[doc = "Possible values of the field `CEIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CEIER {
#[doc = "Interrupt disabled"]
CEIE_0,
#[doc = "Interrupt enabled"]
CEIE_1,
}
impl CEIER {
#[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 as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
CEIER::CEIE_0 => false,
CEIER::CEIE_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> CEIER {
match value {
false => CEIER::CEIE_0,
true => CEIER::CEIE_1,
}
}
#[doc = "Checks if the value of the field is `CEIE_0`"]
#[inline]
pub fn is_ceie_0(&self) -> bool {
*self == CEIER::CEIE_0
}
#[doc = "Checks if the value of the field is `CEIE_1`"]
#[inline]
pub fn is_ceie_1(&self) -> bool {
*self == CEIER::CEIE_1
}
}
#[doc = "Possible values of the field `CEIIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CEIIER {
#[doc = "Interrupt disabled"]
CEIIE_0,
#[doc = "Interrupt enabled"]
CEIIE_1,
}
impl CEIIER {
#[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 as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
CEIIER::CEIIE_0 => false,
CEIIER::CEIIE_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> CEIIER {
match value {
false => CEIIER::CEIIE_0,
true => CEIIER::CEIIE_1,
}
}
#[doc = "Checks if the value of the field is `CEIIE_0`"]
#[inline]
pub fn is_ceiie_0(&self) -> bool {
*self == CEIIER::CEIIE_0
}
#[doc = "Checks if the value of the field is `CEIIE_1`"]
#[inline]
pub fn is_ceiie_1(&self) -> bool {
*self == CEIIER::CEIIE_1
}
}
#[doc = "Possible values of the field `CERDYIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CERDYIER {
#[doc = "Interrupt disabled"]
CERDYIE_0,
#[doc = "Interrupt enabled"]
CERDYIE_1,
}
impl CERDYIER {
#[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 as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
CERDYIER::CERDYIE_0 => false,
CERDYIER::CERDYIE_1 => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> CERDYIER {
match value {
false => CERDYIER::CERDYIE_0,
true => CERDYIER::CERDYIE_1,
}
}
#[doc = "Checks if the value of the field is `CERDYIE_0`"]
#[inline]
pub fn is_cerdyie_0(&self) -> bool {
*self == CERDYIER::CERDYIE_0
}
#[doc = "Checks if the value of the field is `CERDYIE_1`"]
#[inline]
pub fn is_cerdyie_1(&self) -> bool {
*self == CERDYIER::CERDYIE_1
}
}
#[doc = "Values that can be written to the field `CEIFG`"]
pub enum CEIFGW {
#[doc = "No interrupt pending"]
CEIFG_0,
#[doc = "Interrupt pending"]
CEIFG_1,
}
impl CEIFGW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
CEIFGW::CEIFG_0 => false,
CEIFGW::CEIFG_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _CEIFGW<'a> {
w: &'a mut W,
}
impl<'a> _CEIFGW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CEIFGW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "No interrupt pending"]
#[inline]
pub fn ceifg_0(self) -> &'a mut W {
self.variant(CEIFGW::CEIFG_0)
}
#[doc = "Interrupt pending"]
#[inline]
pub fn ceifg_1(self) -> &'a mut W {
self.variant(CEIFGW::CEIFG_1)
}
#[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 u16) << OFFSET);
self.w.bits |= ((value & MASK) as u16) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `CEIIFG`"]
pub enum CEIIFGW {
#[doc = "No interrupt pending"]
CEIIFG_0,
#[doc = "Interrupt pending"]
CEIIFG_1,
}
impl CEIIFGW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
CEIIFGW::CEIIFG_0 => false,
CEIIFGW::CEIIFG_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _CEIIFGW<'a> {
w: &'a mut W,
}
impl<'a> _CEIIFGW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CEIIFGW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "No interrupt pending"]
#[inline]
pub fn ceiifg_0(self) -> &'a mut W {
self.variant(CEIIFGW::CEIIFG_0)
}
#[doc = "Interrupt pending"]
#[inline]
pub fn ceiifg_1(self) -> &'a mut W {
self.variant(CEIIFGW::CEIIFG_1)
}
#[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 = 1;
self.w.bits &= !((MASK as u16) << OFFSET);
self.w.bits |= ((value & MASK) as u16) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `CERDYIFG`"]
pub enum CERDYIFGW {
#[doc = "No interrupt pending"]
CERDYIFG_0,
#[doc = "Interrupt pending"]
CERDYIFG_1,
}
impl CERDYIFGW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
CERDYIFGW::CERDYIFG_0 => false,
CERDYIFGW::CERDYIFG_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _CERDYIFGW<'a> {
w: &'a mut W,
}
impl<'a> _CERDYIFGW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CERDYIFGW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "No interrupt pending"]
#[inline]
pub fn cerdyifg_0(self) -> &'a mut W {
self.variant(CERDYIFGW::CERDYIFG_0)
}
#[doc = "Interrupt pending"]
#[inline]
pub fn cerdyifg_1(self) -> &'a mut W {
self.variant(CERDYIFGW::CERDYIFG_1)
}
#[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 = 4;
self.w.bits &= !((MASK as u16) << OFFSET);
self.w.bits |= ((value & MASK) as u16) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `CEIE`"]
pub enum CEIEW {
#[doc = "Interrupt disabled"]
CEIE_0,
#[doc = "Interrupt enabled"]
CEIE_1,
}
impl CEIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
CEIEW::CEIE_0 => false,
CEIEW::CEIE_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _CEIEW<'a> {
w: &'a mut W,
}
impl<'a> _CEIEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CEIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Interrupt disabled"]
#[inline]
pub fn ceie_0(self) -> &'a mut W {
self.variant(CEIEW::CEIE_0)
}
#[doc = "Interrupt enabled"]
#[inline]
pub fn ceie_1(self) -> &'a mut W {
self.variant(CEIEW::CEIE_1)
}
#[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 = 8;
self.w.bits &= !((MASK as u16) << OFFSET);
self.w.bits |= ((value & MASK) as u16) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `CEIIE`"]
pub enum CEIIEW {
#[doc = "Interrupt disabled"]
CEIIE_0,
#[doc = "Interrupt enabled"]
CEIIE_1,
}
impl CEIIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
CEIIEW::CEIIE_0 => false,
CEIIEW::CEIIE_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _CEIIEW<'a> {
w: &'a mut W,
}
impl<'a> _CEIIEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CEIIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Interrupt disabled"]
#[inline]
pub fn ceiie_0(self) -> &'a mut W {
self.variant(CEIIEW::CEIIE_0)
}
#[doc = "Interrupt enabled"]
#[inline]
pub fn ceiie_1(self) -> &'a mut W {
self.variant(CEIIEW::CEIIE_1)
}
#[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 = 9;
self.w.bits &= !((MASK as u16) << OFFSET);
self.w.bits |= ((value & MASK) as u16) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `CERDYIE`"]
pub enum CERDYIEW {
#[doc = "Interrupt disabled"]
CERDYIE_0,
#[doc = "Interrupt enabled"]
CERDYIE_1,
}
impl CERDYIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
CERDYIEW::CERDYIE_0 => false,
CERDYIEW::CERDYIE_1 => true,
}
}
}
#[doc = r" Proxy"]
pub struct _CERDYIEW<'a> {
w: &'a mut W,
}
impl<'a> _CERDYIEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: CERDYIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Interrupt disabled"]
#[inline]
pub fn cerdyie_0(self) -> &'a mut W {
self.variant(CERDYIEW::CERDYIE_0)
}
#[doc = "Interrupt enabled"]
#[inline]
pub fn cerdyie_1(self) -> &'a mut W {
self.variant(CERDYIEW::CERDYIE_1)
}
#[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 = 12;
self.w.bits &= !((MASK as u16) << OFFSET);
self.w.bits |= ((value & MASK) as u16) << OFFSET;
self.w
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u16 {
self.bits
}
#[doc = "Bit 0 - Comparator output interrupt flag"]
#[inline]
pub fn ceifg(&self) -> CEIFGR {
CEIFGR::_from({
const MASK: bool = true;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u16) != 0
})
}
#[doc = "Bit 1 - Comparator output inverted interrupt flag"]
#[inline]
pub fn ceiifg(&self) -> CEIIFGR {
CEIIFGR::_from({
const MASK: bool = true;
const OFFSET: u8 = 1;
((self.bits >> OFFSET) & MASK as u16) != 0
})
}
#[doc = "Bit 4 - Comparator ready interrupt flag"]
#[inline]
pub fn cerdyifg(&self) -> CERDYIFGR {
CERDYIFGR::_from({
const MASK: bool = true;
const OFFSET: u8 = 4;
((self.bits >> OFFSET) & MASK as u16) != 0
})
}
#[doc = "Bit 8 - Comparator output interrupt enable"]
#[inline]
pub fn ceie(&self) -> CEIER {
CEIER::_from({
const MASK: bool = true;
const OFFSET: u8 = 8;
((self.bits >> OFFSET) & MASK as u16) != 0
})
}
#[doc = "Bit 9 - Comparator output interrupt enable inverted polarity"]
#[inline]
pub fn ceiie(&self) -> CEIIER {
CEIIER::_from({
const MASK: bool = true;
const OFFSET: u8 = 9;
((self.bits >> OFFSET) & MASK as u16) != 0
})
}
#[doc = "Bit 12 - Comparator ready interrupt enable"]
#[inline]
pub fn cerdyie(&self) -> CERDYIER {
CERDYIER::_from({
const MASK: bool = true;
const OFFSET: u8 = 12;
((self.bits >> OFFSET) & MASK as u16) != 0
})
}
}
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: u16) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 0 - Comparator output interrupt flag"]
#[inline]
pub fn ceifg(&mut self) -> _CEIFGW {
_CEIFGW { w: self }
}
#[doc = "Bit 1 - Comparator output inverted interrupt flag"]
#[inline]
pub fn ceiifg(&mut self) -> _CEIIFGW {
_CEIIFGW { w: self }
}
#[doc = "Bit 4 - Comparator ready interrupt flag"]
#[inline]
pub fn cerdyifg(&mut self) -> _CERDYIFGW {
_CERDYIFGW { w: self }
}
#[doc = "Bit 8 - Comparator output interrupt enable"]
#[inline]
pub fn ceie(&mut self) -> _CEIEW {
_CEIEW { w: self }
}
#[doc = "Bit 9 - Comparator output interrupt enable inverted polarity"]
#[inline]
pub fn ceiie(&mut self) -> _CEIIEW {
_CEIIEW { w: self }
}
#[doc = "Bit 12 - Comparator ready interrupt enable"]
#[inline]
pub fn cerdyie(&mut self) -> _CERDYIEW {
_CERDYIEW { w: self }
}
}