#[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::SR {
#[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 `STRT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STRTR {
#[doc = "No regular channel conversion started"]
NOTSTARTED,
#[doc = "Regular channel conversion has started"]
STARTED,
}
impl STRTR {
#[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 {
STRTR::NOTSTARTED => false,
STRTR::STARTED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> STRTR {
match value {
false => STRTR::NOTSTARTED,
true => STRTR::STARTED,
}
}
#[doc = "Checks if the value of the field is `NOTSTARTED`"]
#[inline(always)]
pub fn is_not_started(&self) -> bool {
*self == STRTR::NOTSTARTED
}
#[doc = "Checks if the value of the field is `STARTED`"]
#[inline(always)]
pub fn is_started(&self) -> bool {
*self == STRTR::STARTED
}
}
#[doc = "Values that can be written to the field `STRT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STRTW {
#[doc = "Clear the Regular channel Start flag"]
CLEAR,
}
impl STRTW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
STRTW::CLEAR => false,
}
}
}
#[doc = r"Proxy"]
pub struct _STRTW<'a> {
w: &'a mut W,
}
impl<'a> _STRTW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: STRTW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clear the Regular channel Start flag"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(STRTW::CLEAR)
}
#[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 `JSTRT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum JSTRTR {
#[doc = "No injected group conversion started"]
NOTSTARTED,
#[doc = "Injected group conversion has started"]
STARTED,
}
impl JSTRTR {
#[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 {
JSTRTR::NOTSTARTED => false,
JSTRTR::STARTED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> JSTRTR {
match value {
false => JSTRTR::NOTSTARTED,
true => JSTRTR::STARTED,
}
}
#[doc = "Checks if the value of the field is `NOTSTARTED`"]
#[inline(always)]
pub fn is_not_started(&self) -> bool {
*self == JSTRTR::NOTSTARTED
}
#[doc = "Checks if the value of the field is `STARTED`"]
#[inline(always)]
pub fn is_started(&self) -> bool {
*self == JSTRTR::STARTED
}
}
#[doc = "Values that can be written to the field `JSTRT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum JSTRTW {
#[doc = "Clear Injected channel Start flag"]
CLEAR,
}
impl JSTRTW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
JSTRTW::CLEAR => false,
}
}
}
#[doc = r"Proxy"]
pub struct _JSTRTW<'a> {
w: &'a mut W,
}
impl<'a> _JSTRTW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: JSTRTW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clear Injected channel Start flag"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(JSTRTW::CLEAR)
}
#[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 `JEOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum JEOCR {
#[doc = "Conversion is not complete"]
NOTCOMPLETE,
#[doc = "Conversion complete"]
COMPLETE,
}
impl JEOCR {
#[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 {
JEOCR::NOTCOMPLETE => false,
JEOCR::COMPLETE => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> JEOCR {
match value {
false => JEOCR::NOTCOMPLETE,
true => JEOCR::COMPLETE,
}
}
#[doc = "Checks if the value of the field is `NOTCOMPLETE`"]
#[inline(always)]
pub fn is_not_complete(&self) -> bool {
*self == JEOCR::NOTCOMPLETE
}
#[doc = "Checks if the value of the field is `COMPLETE`"]
#[inline(always)]
pub fn is_complete(&self) -> bool {
*self == JEOCR::COMPLETE
}
}
#[doc = "Values that can be written to the field `JEOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum JEOCW {
#[doc = "Clear Injected channel end of conversion flag"]
CLEAR,
}
impl JEOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
JEOCW::CLEAR => false,
}
}
}
#[doc = r"Proxy"]
pub struct _JEOCW<'a> {
w: &'a mut W,
}
impl<'a> _JEOCW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: JEOCW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clear Injected channel end of conversion flag"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(JEOCW::CLEAR)
}
#[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 = "Possible values of the field `EOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EOCR {
#[doc = "Conversion is not complete"]
NOTCOMPLETE,
#[doc = "Conversion complete"]
COMPLETE,
}
impl EOCR {
#[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 {
EOCR::NOTCOMPLETE => false,
EOCR::COMPLETE => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> EOCR {
match value {
false => EOCR::NOTCOMPLETE,
true => EOCR::COMPLETE,
}
}
#[doc = "Checks if the value of the field is `NOTCOMPLETE`"]
#[inline(always)]
pub fn is_not_complete(&self) -> bool {
*self == EOCR::NOTCOMPLETE
}
#[doc = "Checks if the value of the field is `COMPLETE`"]
#[inline(always)]
pub fn is_complete(&self) -> bool {
*self == EOCR::COMPLETE
}
}
#[doc = "Values that can be written to the field `EOC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EOCW {
#[doc = "Clear End of conversion flag"]
CLEAR,
}
impl EOCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
EOCW::CLEAR => false,
}
}
}
#[doc = r"Proxy"]
pub struct _EOCW<'a> {
w: &'a mut W,
}
impl<'a> _EOCW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EOCW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clear End of conversion flag"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(EOCW::CLEAR)
}
#[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 = "Possible values of the field `AWD`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum AWDR {
#[doc = "No analog watchdog event occurred"]
NOEVENT,
#[doc = "Analog watchdog event occurred"]
EVENT,
}
impl AWDR {
#[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 {
AWDR::NOEVENT => false,
AWDR::EVENT => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> AWDR {
match value {
false => AWDR::NOEVENT,
true => AWDR::EVENT,
}
}
#[doc = "Checks if the value of the field is `NOEVENT`"]
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == AWDR::NOEVENT
}
#[doc = "Checks if the value of the field is `EVENT`"]
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == AWDR::EVENT
}
}
#[doc = "Values that can be written to the field `AWD`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum AWDW {
#[doc = "Clear the analog watchdog event flag"]
CLEAR,
}
impl AWDW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
AWDW::CLEAR => false,
}
}
}
#[doc = r"Proxy"]
pub struct _AWDW<'a> {
w: &'a mut W,
}
impl<'a> _AWDW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: AWDW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Clear the analog watchdog event flag"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(AWDW::CLEAR)
}
#[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 4 - Regular channel start flag"]
#[inline(always)]
pub fn strt(&self) -> STRTR {
STRTR::_from(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - Injected channel start flag"]
#[inline(always)]
pub fn jstrt(&self) -> JSTRTR {
JSTRTR::_from(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - Injected channel end of conversion"]
#[inline(always)]
pub fn jeoc(&self) -> JEOCR {
JEOCR::_from(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - Regular channel end of conversion"]
#[inline(always)]
pub fn eoc(&self) -> EOCR {
EOCR::_from(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - Analog watchdog flag"]
#[inline(always)]
pub fn awd(&self) -> AWDR {
AWDR::_from(((self.bits >> 0) & 0x01) != 0)
}
}
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 4 - Regular channel start flag"]
#[inline(always)]
pub fn strt(&mut self) -> _STRTW {
_STRTW { w: self }
}
#[doc = "Bit 3 - Injected channel start flag"]
#[inline(always)]
pub fn jstrt(&mut self) -> _JSTRTW {
_JSTRTW { w: self }
}
#[doc = "Bit 2 - Injected channel end of conversion"]
#[inline(always)]
pub fn jeoc(&mut self) -> _JEOCW {
_JEOCW { w: self }
}
#[doc = "Bit 1 - Regular channel end of conversion"]
#[inline(always)]
pub fn eoc(&mut self) -> _EOCW {
_EOCW { w: self }
}
#[doc = "Bit 0 - Analog watchdog flag"]
#[inline(always)]
pub fn awd(&mut self) -> _AWDW {
_AWDW { w: self }
}
}