#[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::OSPEEDR {
#[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 `OSPEEDR0`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OSPEEDR0R {
#[doc = "Low speed"]
LOWSPEED,
#[doc = "Medium speed"]
MEDIUMSPEED,
#[doc = "High speed"]
HIGHSPEED,
#[doc = "Very high speed"]
VERYHIGHSPEED,
}
impl OSPEEDR0R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u8 {
match *self {
OSPEEDR0R::LOWSPEED => 0,
OSPEEDR0R::MEDIUMSPEED => 1,
OSPEEDR0R::HIGHSPEED => 2,
OSPEEDR0R::VERYHIGHSPEED => 3,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: u8) -> OSPEEDR0R {
match value {
0 => OSPEEDR0R::LOWSPEED,
1 => OSPEEDR0R::MEDIUMSPEED,
2 => OSPEEDR0R::HIGHSPEED,
3 => OSPEEDR0R::VERYHIGHSPEED,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `LOWSPEED`"]
#[inline]
pub fn is_low_speed(&self) -> bool {
*self == OSPEEDR0R::LOWSPEED
}
#[doc = "Checks if the value of the field is `MEDIUMSPEED`"]
#[inline]
pub fn is_medium_speed(&self) -> bool {
*self == OSPEEDR0R::MEDIUMSPEED
}
#[doc = "Checks if the value of the field is `HIGHSPEED`"]
#[inline]
pub fn is_high_speed(&self) -> bool {
*self == OSPEEDR0R::HIGHSPEED
}
#[doc = "Checks if the value of the field is `VERYHIGHSPEED`"]
#[inline]
pub fn is_very_high_speed(&self) -> bool {
*self == OSPEEDR0R::VERYHIGHSPEED
}
}
#[doc = "Possible values of the field `OSPEEDR1`"]
pub type OSPEEDR1R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR2`"]
pub type OSPEEDR2R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR3`"]
pub type OSPEEDR3R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR4`"]
pub type OSPEEDR4R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR5`"]
pub type OSPEEDR5R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR6`"]
pub type OSPEEDR6R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR7`"]
pub type OSPEEDR7R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR8`"]
pub type OSPEEDR8R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR9`"]
pub type OSPEEDR9R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR10`"]
pub type OSPEEDR10R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR11`"]
pub type OSPEEDR11R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR12`"]
pub type OSPEEDR12R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR13`"]
pub type OSPEEDR13R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR14`"]
pub type OSPEEDR14R = OSPEEDR0R;
#[doc = "Possible values of the field `OSPEEDR15`"]
pub type OSPEEDR15R = OSPEEDR0R;
#[doc = "Values that can be written to the field `OSPEEDR0`"]
pub enum OSPEEDR0W {
#[doc = "Low speed"]
LOWSPEED,
#[doc = "Medium speed"]
MEDIUMSPEED,
#[doc = "High speed"]
HIGHSPEED,
#[doc = "Very high speed"]
VERYHIGHSPEED,
}
impl OSPEEDR0W {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
OSPEEDR0W::LOWSPEED => 0,
OSPEEDR0W::MEDIUMSPEED => 1,
OSPEEDR0W::HIGHSPEED => 2,
OSPEEDR0W::VERYHIGHSPEED => 3,
}
}
}
#[doc = r" Proxy"]
pub struct _OSPEEDR0W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR0W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR0W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 0;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR1`"]
pub type OSPEEDR1W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR1W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR1W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR1W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub 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 = "Values that can be written to the field `OSPEEDR2`"]
pub type OSPEEDR2W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR2W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR2W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR2W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 4;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR3`"]
pub type OSPEEDR3W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR3W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR3W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR3W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 6;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR4`"]
pub type OSPEEDR4W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR4W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR4W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR4W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 8;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR5`"]
pub type OSPEEDR5W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR5W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR5W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR5W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 10;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR6`"]
pub type OSPEEDR6W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR6W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR6W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR6W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 12;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR7`"]
pub type OSPEEDR7W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR7W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR7W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR7W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 14;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR8`"]
pub type OSPEEDR8W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR8W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR8W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR8W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub 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 = "Values that can be written to the field `OSPEEDR9`"]
pub type OSPEEDR9W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR9W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR9W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR9W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 18;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR10`"]
pub type OSPEEDR10W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR10W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR10W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR10W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 20;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR11`"]
pub type OSPEEDR11W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR11W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR11W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR11W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 22;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR12`"]
pub type OSPEEDR12W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR12W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR12W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR12W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 24;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR13`"]
pub type OSPEEDR13W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR13W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR13W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR13W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 26;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR14`"]
pub type OSPEEDR14W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR14W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR14W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR14W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 28;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `OSPEEDR15`"]
pub type OSPEEDR15W = OSPEEDR0W;
#[doc = r" Proxy"]
pub struct _OSPEEDR15W<'a> {
w: &'a mut W,
}
impl<'a> _OSPEEDR15W<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: OSPEEDR15W) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low speed"]
#[inline]
pub fn low_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::LOWSPEED)
}
#[doc = "Medium speed"]
#[inline]
pub fn medium_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::MEDIUMSPEED)
}
#[doc = "High speed"]
#[inline]
pub fn high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::HIGHSPEED)
}
#[doc = "Very high speed"]
#[inline]
pub fn very_high_speed(self) -> &'a mut W {
self.variant(OSPEEDR0W::VERYHIGHSPEED)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 3;
const OFFSET: u8 = 30;
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 = "Bits 0:1 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr0(&self) -> OSPEEDR0R {
OSPEEDR0R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 2:3 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr1(&self) -> OSPEEDR1R {
OSPEEDR1R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 2;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 4:5 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr2(&self) -> OSPEEDR2R {
OSPEEDR2R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 4;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 6:7 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr3(&self) -> OSPEEDR3R {
OSPEEDR3R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 6;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 8:9 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr4(&self) -> OSPEEDR4R {
OSPEEDR4R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 8;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 10:11 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr5(&self) -> OSPEEDR5R {
OSPEEDR5R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 10;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 12:13 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr6(&self) -> OSPEEDR6R {
OSPEEDR6R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 12;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 14:15 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr7(&self) -> OSPEEDR7R {
OSPEEDR7R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 14;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 16:17 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr8(&self) -> OSPEEDR8R {
OSPEEDR8R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 16;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 18:19 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr9(&self) -> OSPEEDR9R {
OSPEEDR9R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 18;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 20:21 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr10(&self) -> OSPEEDR10R {
OSPEEDR10R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 20;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 22:23 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr11(&self) -> OSPEEDR11R {
OSPEEDR11R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 22;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 24:25 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr12(&self) -> OSPEEDR12R {
OSPEEDR12R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 24;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 26:27 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr13(&self) -> OSPEEDR13R {
OSPEEDR13R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 26;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 28:29 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr14(&self) -> OSPEEDR14R {
OSPEEDR14R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 28;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 30:31 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr15(&self) -> OSPEEDR15R {
OSPEEDR15R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 30;
((self.bits >> OFFSET) & MASK as u32) as u8
})
}
}
impl W {
#[doc = r" Reset value of the register"]
#[inline]
pub fn reset_value() -> W {
W { bits: 201326592 }
}
#[doc = r" Writes raw bits to the register"]
#[inline]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bits 0:1 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr0(&mut self) -> _OSPEEDR0W {
_OSPEEDR0W { w: self }
}
#[doc = "Bits 2:3 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr1(&mut self) -> _OSPEEDR1W {
_OSPEEDR1W { w: self }
}
#[doc = "Bits 4:5 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr2(&mut self) -> _OSPEEDR2W {
_OSPEEDR2W { w: self }
}
#[doc = "Bits 6:7 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr3(&mut self) -> _OSPEEDR3W {
_OSPEEDR3W { w: self }
}
#[doc = "Bits 8:9 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr4(&mut self) -> _OSPEEDR4W {
_OSPEEDR4W { w: self }
}
#[doc = "Bits 10:11 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr5(&mut self) -> _OSPEEDR5W {
_OSPEEDR5W { w: self }
}
#[doc = "Bits 12:13 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr6(&mut self) -> _OSPEEDR6W {
_OSPEEDR6W { w: self }
}
#[doc = "Bits 14:15 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr7(&mut self) -> _OSPEEDR7W {
_OSPEEDR7W { w: self }
}
#[doc = "Bits 16:17 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr8(&mut self) -> _OSPEEDR8W {
_OSPEEDR8W { w: self }
}
#[doc = "Bits 18:19 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr9(&mut self) -> _OSPEEDR9W {
_OSPEEDR9W { w: self }
}
#[doc = "Bits 20:21 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr10(&mut self) -> _OSPEEDR10W {
_OSPEEDR10W { w: self }
}
#[doc = "Bits 22:23 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr11(&mut self) -> _OSPEEDR11W {
_OSPEEDR11W { w: self }
}
#[doc = "Bits 24:25 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr12(&mut self) -> _OSPEEDR12W {
_OSPEEDR12W { w: self }
}
#[doc = "Bits 26:27 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr13(&mut self) -> _OSPEEDR13W {
_OSPEEDR13W { w: self }
}
#[doc = "Bits 28:29 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr14(&mut self) -> _OSPEEDR14W {
_OSPEEDR14W { w: self }
}
#[doc = "Bits 30:31 - 1:0\\]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O output speed. Note: Refer to the device datasheet for the frequency specifications and the power supply and load conditions for each speed."]
#[inline]
pub fn ospeedr15(&mut self) -> _OSPEEDR15W {
_OSPEEDR15W { w: self }
}
}