#[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 = "Possible values of the field `ROVSE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ROVSER {
#[doc = "Regular oversampling disabled"]
DISABLED,
#[doc = "Regular oversampling enabled"]
ENABLED,
}
impl ROVSER {
#[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 {
ROVSER::DISABLED => false,
ROVSER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ROVSER {
match value {
false => ROVSER::DISABLED,
true => ROVSER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ROVSER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ROVSER::ENABLED
}
}
#[doc = "Values that can be written to the field `ROVSE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ROVSEW {
#[doc = "Regular oversampling disabled"]
DISABLED,
#[doc = "Regular oversampling enabled"]
ENABLED,
}
impl ROVSEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ROVSEW::DISABLED => false,
ROVSEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ROVSEW<'a> {
w: &'a mut W,
}
impl<'a> _ROVSEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ROVSEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Regular oversampling disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ROVSEW::DISABLED)
}
#[doc = "Regular oversampling enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ROVSEW::ENABLED)
}
#[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
}
}
#[doc = "Possible values of the field `JOVSE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum JOVSER {
#[doc = "Injected oversampling disabled"]
DISABLED,
#[doc = "Injected oversampling enabled"]
ENABLED,
}
impl JOVSER {
#[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 {
JOVSER::DISABLED => false,
JOVSER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> JOVSER {
match value {
false => JOVSER::DISABLED,
true => JOVSER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JOVSER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JOVSER::ENABLED
}
}
#[doc = "Values that can be written to the field `JOVSE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum JOVSEW {
#[doc = "Injected oversampling disabled"]
DISABLED,
#[doc = "Injected oversampling enabled"]
ENABLED,
}
impl JOVSEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
JOVSEW::DISABLED => false,
JOVSEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _JOVSEW<'a> {
w: &'a mut W,
}
impl<'a> _JOVSEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: JOVSEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Injected oversampling disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(JOVSEW::DISABLED)
}
#[doc = "Injected oversampling enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(JOVSEW::ENABLED)
}
#[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 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 = "Possible values of the field `TROVS`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TROVSR {
#[doc = "All oversampled conversions for a channel are run following a trigger"]
AUTOMATIC,
#[doc = "Each oversampled conversion for a channel needs a new trigger"]
TRIGGERED,
}
impl TROVSR {
#[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 {
TROVSR::AUTOMATIC => false,
TROVSR::TRIGGERED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TROVSR {
match value {
false => TROVSR::AUTOMATIC,
true => TROVSR::TRIGGERED,
}
}
#[doc = "Checks if the value of the field is `AUTOMATIC`"]
#[inline(always)]
pub fn is_automatic(&self) -> bool {
*self == TROVSR::AUTOMATIC
}
#[doc = "Checks if the value of the field is `TRIGGERED`"]
#[inline(always)]
pub fn is_triggered(&self) -> bool {
*self == TROVSR::TRIGGERED
}
}
#[doc = "Values that can be written to the field `TROVS`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TROVSW {
#[doc = "All oversampled conversions for a channel are run following a trigger"]
AUTOMATIC,
#[doc = "Each oversampled conversion for a channel needs a new trigger"]
TRIGGERED,
}
impl TROVSW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TROVSW::AUTOMATIC => false,
TROVSW::TRIGGERED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TROVSW<'a> {
w: &'a mut W,
}
impl<'a> _TROVSW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TROVSW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "All oversampled conversions for a channel are run following a trigger"]
#[inline(always)]
pub fn automatic(self) -> &'a mut W {
self.variant(TROVSW::AUTOMATIC)
}
#[doc = "Each oversampled conversion for a channel needs a new trigger"]
#[inline(always)]
pub fn triggered(self) -> &'a mut W {
self.variant(TROVSW::TRIGGERED)
}
#[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 = "Possible values of the field `ROVSM`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ROVSMR {
#[doc = "Oversampling is temporary stopped and continued after injection sequence"]
CONTINUED,
#[doc = "Oversampling is aborted and resumed from start after injection sequence"]
RESUMED,
}
impl ROVSMR {
#[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 {
ROVSMR::CONTINUED => false,
ROVSMR::RESUMED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ROVSMR {
match value {
false => ROVSMR::CONTINUED,
true => ROVSMR::RESUMED,
}
}
#[doc = "Checks if the value of the field is `CONTINUED`"]
#[inline(always)]
pub fn is_continued(&self) -> bool {
*self == ROVSMR::CONTINUED
}
#[doc = "Checks if the value of the field is `RESUMED`"]
#[inline(always)]
pub fn is_resumed(&self) -> bool {
*self == ROVSMR::RESUMED
}
}
#[doc = "Values that can be written to the field `ROVSM`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ROVSMW {
#[doc = "Oversampling is temporary stopped and continued after injection sequence"]
CONTINUED,
#[doc = "Oversampling is aborted and resumed from start after injection sequence"]
RESUMED,
}
impl ROVSMW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ROVSMW::CONTINUED => false,
ROVSMW::RESUMED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ROVSMW<'a> {
w: &'a mut W,
}
impl<'a> _ROVSMW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ROVSMW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Oversampling is temporary stopped and continued after injection sequence"]
#[inline(always)]
pub fn continued(self) -> &'a mut W {
self.variant(ROVSMW::CONTINUED)
}
#[doc = "Oversampling is aborted and resumed from start after injection sequence"]
#[inline(always)]
pub fn resumed(self) -> &'a mut W {
self.variant(ROVSMW::RESUMED)
}
#[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 = "Possible values of the field `RSHIFT1`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RSHIFT1R {
#[doc = "Right-shifting disabled"]
DISABLED,
#[doc = "Data is right-shifted 1-bit"]
ENABLED,
}
impl RSHIFT1R {
#[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 {
RSHIFT1R::DISABLED => false,
RSHIFT1R::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> RSHIFT1R {
match value {
false => RSHIFT1R::DISABLED,
true => RSHIFT1R::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RSHIFT1R::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RSHIFT1R::ENABLED
}
}
#[doc = "Values that can be written to the field `RSHIFT1`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RSHIFT1W {
#[doc = "Right-shifting disabled"]
DISABLED,
#[doc = "Data is right-shifted 1-bit"]
ENABLED,
}
impl RSHIFT1W {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
RSHIFT1W::DISABLED => false,
RSHIFT1W::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _RSHIFT1W<'a> {
w: &'a mut W,
}
impl<'a> _RSHIFT1W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RSHIFT1W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Right-shifting disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RSHIFT1W::DISABLED)
}
#[doc = "Data is right-shifted 1-bit"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RSHIFT1W::ENABLED)
}
#[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 << 11);
self.w.bits |= ((value as u32) & 0x01) << 11;
self.w
}
}
#[doc = "Possible values of the field `RSHIFT2`"]
pub type RSHIFT2R = RSHIFT1R;
#[doc = "Values that can be written to the field `RSHIFT2`"]
pub type RSHIFT2W = RSHIFT1W;
#[doc = r"Proxy"]
pub struct _RSHIFT2W<'a> {
w: &'a mut W,
}
impl<'a> _RSHIFT2W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RSHIFT2W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Right-shifting disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RSHIFT1W::DISABLED)
}
#[doc = "Data is right-shifted 1-bit"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RSHIFT1W::ENABLED)
}
#[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 << 12);
self.w.bits |= ((value as u32) & 0x01) << 12;
self.w
}
}
#[doc = "Possible values of the field `RSHIFT3`"]
pub type RSHIFT3R = RSHIFT1R;
#[doc = "Values that can be written to the field `RSHIFT3`"]
pub type RSHIFT3W = RSHIFT1W;
#[doc = r"Proxy"]
pub struct _RSHIFT3W<'a> {
w: &'a mut W,
}
impl<'a> _RSHIFT3W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RSHIFT3W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Right-shifting disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RSHIFT1W::DISABLED)
}
#[doc = "Data is right-shifted 1-bit"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RSHIFT1W::ENABLED)
}
#[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 << 13);
self.w.bits |= ((value as u32) & 0x01) << 13;
self.w
}
}
#[doc = "Possible values of the field `RSHIFT4`"]
pub type RSHIFT4R = RSHIFT1R;
#[doc = "Values that can be written to the field `RSHIFT4`"]
pub type RSHIFT4W = RSHIFT1W;
#[doc = r"Proxy"]
pub struct _RSHIFT4W<'a> {
w: &'a mut W,
}
impl<'a> _RSHIFT4W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: RSHIFT4W) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Right-shifting disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(RSHIFT1W::DISABLED)
}
#[doc = "Data is right-shifted 1-bit"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(RSHIFT1W::ENABLED)
}
#[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 << 14);
self.w.bits |= ((value as u32) & 0x01) << 14;
self.w
}
}
#[doc = r"Value of the field"]
pub struct OSVRR {
bits: u16,
}
impl OSVRR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u16 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _OSVRW<'a> {
w: &'a mut W,
}
impl<'a> _OSVRW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u16) -> &'a mut W {
self.w.bits &= !(0x03ff << 16);
self.w.bits |= ((value as u32) & 0x03ff) << 16;
self.w
}
}
#[doc = r"Value of the field"]
pub struct LSHIFTR {
bits: u8,
}
impl LSHIFTR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _LSHIFTW<'a> {
w: &'a mut W,
}
impl<'a> _LSHIFTW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x0f << 28);
self.w.bits |= ((value as u32) & 0x0f) << 28;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 0 - ADC oversampler enable on scope ADC group regular"]
#[inline(always)]
pub fn rovse(&self) -> ROVSER {
ROVSER::_from(((self.bits >> 0) & 0x01) != 0)
}
#[doc = "Bit 1 - ADC oversampler enable on scope ADC group injected"]
#[inline(always)]
pub fn jovse(&self) -> JOVSER {
JOVSER::_from(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bits 5:8 - ADC oversampling shift"]
#[inline(always)]
pub fn ovss(&self) -> OVSSR {
let bits = ((self.bits >> 5) & 0x0f) as u8;
OVSSR { bits }
}
#[doc = "Bit 9 - ADC oversampling discontinuous mode (triggered mode) for ADC group regular"]
#[inline(always)]
pub fn trovs(&self) -> TROVSR {
TROVSR::_from(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 10 - Regular Oversampling mode"]
#[inline(always)]
pub fn rovsm(&self) -> ROVSMR {
ROVSMR::_from(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 11 - Right-shift data after Offset 1 correction"]
#[inline(always)]
pub fn rshift1(&self) -> RSHIFT1R {
RSHIFT1R::_from(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 12 - Right-shift data after Offset 2 correction"]
#[inline(always)]
pub fn rshift2(&self) -> RSHIFT2R {
RSHIFT2R::_from(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 13 - Right-shift data after Offset 3 correction"]
#[inline(always)]
pub fn rshift3(&self) -> RSHIFT3R {
RSHIFT3R::_from(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 14 - Right-shift data after Offset 4 correction"]
#[inline(always)]
pub fn rshift4(&self) -> RSHIFT4R {
RSHIFT4R::_from(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bits 16:25 - Oversampling ratio"]
#[inline(always)]
pub fn osvr(&self) -> OSVRR {
let bits = ((self.bits >> 16) & 0x03ff) as u16;
OSVRR { bits }
}
#[doc = "Bits 28:31 - Left shift factor"]
#[inline(always)]
pub fn lshift(&self) -> LSHIFTR {
let bits = ((self.bits >> 28) & 0x0f) as u8;
LSHIFTR { 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 0 - ADC oversampler enable on scope ADC group regular"]
#[inline(always)]
pub fn rovse(&mut self) -> _ROVSEW {
_ROVSEW { w: self }
}
#[doc = "Bit 1 - ADC oversampler enable on scope ADC group injected"]
#[inline(always)]
pub fn jovse(&mut self) -> _JOVSEW {
_JOVSEW { w: self }
}
#[doc = "Bits 5:8 - ADC oversampling shift"]
#[inline(always)]
pub fn ovss(&mut self) -> _OVSSW {
_OVSSW { w: self }
}
#[doc = "Bit 9 - ADC oversampling discontinuous mode (triggered mode) for ADC group regular"]
#[inline(always)]
pub fn trovs(&mut self) -> _TROVSW {
_TROVSW { w: self }
}
#[doc = "Bit 10 - Regular Oversampling mode"]
#[inline(always)]
pub fn rovsm(&mut self) -> _ROVSMW {
_ROVSMW { w: self }
}
#[doc = "Bit 11 - Right-shift data after Offset 1 correction"]
#[inline(always)]
pub fn rshift1(&mut self) -> _RSHIFT1W {
_RSHIFT1W { w: self }
}
#[doc = "Bit 12 - Right-shift data after Offset 2 correction"]
#[inline(always)]
pub fn rshift2(&mut self) -> _RSHIFT2W {
_RSHIFT2W { w: self }
}
#[doc = "Bit 13 - Right-shift data after Offset 3 correction"]
#[inline(always)]
pub fn rshift3(&mut self) -> _RSHIFT3W {
_RSHIFT3W { w: self }
}
#[doc = "Bit 14 - Right-shift data after Offset 4 correction"]
#[inline(always)]
pub fn rshift4(&mut self) -> _RSHIFT4W {
_RSHIFT4W { w: self }
}
#[doc = "Bits 16:25 - Oversampling ratio"]
#[inline(always)]
pub fn osvr(&mut self) -> _OSVRW {
_OSVRW { w: self }
}
#[doc = "Bits 28:31 - Left shift factor"]
#[inline(always)]
pub fn lshift(&mut self) -> _LSHIFTW {
_LSHIFTW { w: self }
}
}