#[doc = "BSRR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Bsrr(pub u32);
impl Bsrr {
#[doc = "Port x pin y set bit"]
#[must_use]
#[inline(always)]
pub const fn bs0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Port x pin y set bit"]
#[inline(always)]
pub const fn set_bs0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Port x pin y set bit"]
#[must_use]
#[inline(always)]
pub const fn bs1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Port x pin y set bit"]
#[inline(always)]
pub const fn set_bs1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Port x pin y set bit"]
#[must_use]
#[inline(always)]
pub const fn bs2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Port x pin y set bit"]
#[inline(always)]
pub const fn set_bs2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Port x pin y set bit"]
#[must_use]
#[inline(always)]
pub const fn bs3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Port x pin y set bit"]
#[inline(always)]
pub const fn set_bs3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Port x pin y set bit"]
#[must_use]
#[inline(always)]
pub const fn bs4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y set bit"]
#[inline(always)]
pub const fn set_bs4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y set bit"]
#[must_use]
#[inline(always)]
pub const fn bs5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y set bit"]
#[inline(always)]
pub const fn set_bs5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y set bit"]
#[must_use]
#[inline(always)]
pub const fn bs6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y set bit"]
#[inline(always)]
pub const fn set_bs6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Port x pin y reset control"]
#[must_use]
#[inline(always)]
pub const fn br0(&self) -> bool {
let val = (self.0 >> 16usize) & 0x01;
val != 0
}
#[doc = "Port x pin y reset control"]
#[inline(always)]
pub const fn set_br0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
}
#[doc = "Port x pin y reset control"]
#[must_use]
#[inline(always)]
pub const fn br1(&self) -> bool {
let val = (self.0 >> 17usize) & 0x01;
val != 0
}
#[doc = "Port x pin y reset control"]
#[inline(always)]
pub const fn set_br1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
}
#[doc = "Port x pin y reset control"]
#[must_use]
#[inline(always)]
pub const fn br2(&self) -> bool {
let val = (self.0 >> 18usize) & 0x01;
val != 0
}
#[doc = "Port x pin y reset control"]
#[inline(always)]
pub const fn set_br2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
}
#[doc = "Port x pin y reset control"]
#[must_use]
#[inline(always)]
pub const fn br3(&self) -> bool {
let val = (self.0 >> 19usize) & 0x01;
val != 0
}
#[doc = "Port x pin y reset control"]
#[inline(always)]
pub const fn set_br3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
}
#[doc = "Port x pin y reset control"]
#[must_use]
#[inline(always)]
pub const fn br4(&self) -> bool {
let val = (self.0 >> 20usize) & 0x01;
val != 0
}
#[doc = "Port x pin y reset control"]
#[inline(always)]
pub const fn set_br4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
}
#[doc = "Port x pin y reset control"]
#[must_use]
#[inline(always)]
pub const fn br5(&self) -> bool {
let val = (self.0 >> 21usize) & 0x01;
val != 0
}
#[doc = "Port x pin y reset control"]
#[inline(always)]
pub const fn set_br5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
}
#[doc = "Port x pin y reset control"]
#[must_use]
#[inline(always)]
pub const fn br6(&self) -> bool {
let val = (self.0 >> 22usize) & 0x01;
val != 0
}
#[doc = "Port x pin y reset control"]
#[inline(always)]
pub const fn set_br6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
}
}
impl Default for Bsrr {
#[inline(always)]
fn default() -> Bsrr {
Bsrr(0)
}
}
impl core::fmt::Debug for Bsrr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Bsrr")
.field("bs0", &self.bs0())
.field("bs1", &self.bs1())
.field("bs2", &self.bs2())
.field("bs3", &self.bs3())
.field("bs4", &self.bs4())
.field("bs5", &self.bs5())
.field("bs6", &self.bs6())
.field("br0", &self.br0())
.field("br1", &self.br1())
.field("br2", &self.br2())
.field("br3", &self.br3())
.field("br4", &self.br4())
.field("br5", &self.br5())
.field("br6", &self.br6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Bsrr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Bsrr {{ bs0: {=bool:?}, bs1: {=bool:?}, bs2: {=bool:?}, bs3: {=bool:?}, bs4: {=bool:?}, bs5: {=bool:?}, bs6: {=bool:?}, br0: {=bool:?}, br1: {=bool:?}, br2: {=bool:?}, br3: {=bool:?}, br4: {=bool:?}, br5: {=bool:?}, br6: {=bool:?} }}" , self . bs0 () , self . bs1 () , self . bs2 () , self . bs3 () , self . bs4 () , self . bs5 () , self . bs6 () , self . br0 () , self . br1 () , self . br2 () , self . br3 () , self . br4 () , self . br5 () , self . br6 ())
}
}
#[doc = "CFG0"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfgy(pub u32);
impl Cfgy {
#[doc = "Port x pin y mode configuration"]
#[must_use]
#[inline(always)]
pub const fn modery(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Port x pin y mode configuration"]
#[inline(always)]
pub const fn set_modery(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Port x pin y output type configuration"]
#[must_use]
#[inline(always)]
pub const fn oty(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output type configuration"]
#[inline(always)]
pub const fn set_oty(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y pull down configuration"]
#[must_use]
#[inline(always)]
pub const fn pdy(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull down configuration"]
#[inline(always)]
pub const fn set_pdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y pull up configuration"]
#[must_use]
#[inline(always)]
pub const fn puy(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull up configuration"]
#[inline(always)]
pub const fn set_puy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Alternate function selection bits of port x pin y"]
#[must_use]
#[inline(always)]
pub const fn afsely(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x07;
val as u8
}
#[doc = "Alternate function selection bits of port x pin y"]
#[inline(always)]
pub const fn set_afsely(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
}
}
impl Default for Cfgy {
#[inline(always)]
fn default() -> Cfgy {
Cfgy(0)
}
}
impl core::fmt::Debug for Cfgy {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfgy")
.field("modery", &self.modery())
.field("oty", &self.oty())
.field("pdy", &self.pdy())
.field("puy", &self.puy())
.field("afsely", &self.afsely())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfgy {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfgy {{ modery: {=u8:?}, oty: {=bool:?}, pdy: {=bool:?}, puy: {=bool:?}, afsely: {=u8:?} }}" , self . modery () , self . oty () , self . pdy () , self . puy () , self . afsely ())
}
}
#[doc = "CFG1"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfg1(pub u32);
impl Cfg1 {
#[doc = "Port x pin y mode configuration"]
#[must_use]
#[inline(always)]
pub const fn modery(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Port x pin y mode configuration"]
#[inline(always)]
pub const fn set_modery(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Port x pin y output type configuration"]
#[must_use]
#[inline(always)]
pub const fn oty(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output type configuration"]
#[inline(always)]
pub const fn set_oty(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y pull down configuration"]
#[must_use]
#[inline(always)]
pub const fn pdy(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull down configuration"]
#[inline(always)]
pub const fn set_pdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y pull up configuration"]
#[must_use]
#[inline(always)]
pub const fn puy(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull up configuration"]
#[inline(always)]
pub const fn set_puy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Alternate function selection bits of port x pin y"]
#[must_use]
#[inline(always)]
pub const fn afsely(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x07;
val as u8
}
#[doc = "Alternate function selection bits of port x pin y"]
#[inline(always)]
pub const fn set_afsely(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
}
}
impl Default for Cfg1 {
#[inline(always)]
fn default() -> Cfg1 {
Cfg1(0)
}
}
impl core::fmt::Debug for Cfg1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfg1")
.field("modery", &self.modery())
.field("oty", &self.oty())
.field("pdy", &self.pdy())
.field("puy", &self.puy())
.field("afsely", &self.afsely())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfg1 {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfg1 {{ modery: {=u8:?}, oty: {=bool:?}, pdy: {=bool:?}, puy: {=bool:?}, afsely: {=u8:?} }}" , self . modery () , self . oty () , self . pdy () , self . puy () , self . afsely ())
}
}
#[doc = "CFG2"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfg2(pub u32);
impl Cfg2 {
#[doc = "Port x pin y mode configuration"]
#[must_use]
#[inline(always)]
pub const fn modery(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Port x pin y mode configuration"]
#[inline(always)]
pub const fn set_modery(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Port x pin y output type configuration"]
#[must_use]
#[inline(always)]
pub const fn oty(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output type configuration"]
#[inline(always)]
pub const fn set_oty(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y pull down configuration"]
#[must_use]
#[inline(always)]
pub const fn pdy(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull down configuration"]
#[inline(always)]
pub const fn set_pdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y pull up configuration"]
#[must_use]
#[inline(always)]
pub const fn puy(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull up configuration"]
#[inline(always)]
pub const fn set_puy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Alternate function selection bits of port x pin y"]
#[must_use]
#[inline(always)]
pub const fn afsely(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x07;
val as u8
}
#[doc = "Alternate function selection bits of port x pin y"]
#[inline(always)]
pub const fn set_afsely(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
}
}
impl Default for Cfg2 {
#[inline(always)]
fn default() -> Cfg2 {
Cfg2(0)
}
}
impl core::fmt::Debug for Cfg2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfg2")
.field("modery", &self.modery())
.field("oty", &self.oty())
.field("pdy", &self.pdy())
.field("puy", &self.puy())
.field("afsely", &self.afsely())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfg2 {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfg2 {{ modery: {=u8:?}, oty: {=bool:?}, pdy: {=bool:?}, puy: {=bool:?}, afsely: {=u8:?} }}" , self . modery () , self . oty () , self . pdy () , self . puy () , self . afsely ())
}
}
#[doc = "CFG3"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfg3(pub u32);
impl Cfg3 {
#[doc = "Port x pin y mode configuration"]
#[must_use]
#[inline(always)]
pub const fn modery(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Port x pin y mode configuration"]
#[inline(always)]
pub const fn set_modery(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Port x pin y output type configuration"]
#[must_use]
#[inline(always)]
pub const fn oty(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output type configuration"]
#[inline(always)]
pub const fn set_oty(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y pull down configuration"]
#[must_use]
#[inline(always)]
pub const fn pdy(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull down configuration"]
#[inline(always)]
pub const fn set_pdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y pull up configuration"]
#[must_use]
#[inline(always)]
pub const fn puy(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull up configuration"]
#[inline(always)]
pub const fn set_puy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Alternate function selection bits of port x pin y"]
#[must_use]
#[inline(always)]
pub const fn afsely(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x07;
val as u8
}
#[doc = "Alternate function selection bits of port x pin y"]
#[inline(always)]
pub const fn set_afsely(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
}
}
impl Default for Cfg3 {
#[inline(always)]
fn default() -> Cfg3 {
Cfg3(0)
}
}
impl core::fmt::Debug for Cfg3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfg3")
.field("modery", &self.modery())
.field("oty", &self.oty())
.field("pdy", &self.pdy())
.field("puy", &self.puy())
.field("afsely", &self.afsely())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfg3 {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfg3 {{ modery: {=u8:?}, oty: {=bool:?}, pdy: {=bool:?}, puy: {=bool:?}, afsely: {=u8:?} }}" , self . modery () , self . oty () , self . pdy () , self . puy () , self . afsely ())
}
}
#[doc = "CFG4"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfg4(pub u32);
impl Cfg4 {
#[doc = "Port x pin y mode configuration"]
#[must_use]
#[inline(always)]
pub const fn modery(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Port x pin y mode configuration"]
#[inline(always)]
pub const fn set_modery(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Port x pin y output type configuration"]
#[must_use]
#[inline(always)]
pub const fn oty(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output type configuration"]
#[inline(always)]
pub const fn set_oty(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y pull down configuration"]
#[must_use]
#[inline(always)]
pub const fn pdy(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull down configuration"]
#[inline(always)]
pub const fn set_pdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y pull up configuration"]
#[must_use]
#[inline(always)]
pub const fn puy(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull up configuration"]
#[inline(always)]
pub const fn set_puy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Alternate function selection bits of port x pin y"]
#[must_use]
#[inline(always)]
pub const fn afsely(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x07;
val as u8
}
#[doc = "Alternate function selection bits of port x pin y"]
#[inline(always)]
pub const fn set_afsely(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
}
}
impl Default for Cfg4 {
#[inline(always)]
fn default() -> Cfg4 {
Cfg4(0)
}
}
impl core::fmt::Debug for Cfg4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfg4")
.field("modery", &self.modery())
.field("oty", &self.oty())
.field("pdy", &self.pdy())
.field("puy", &self.puy())
.field("afsely", &self.afsely())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfg4 {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfg4 {{ modery: {=u8:?}, oty: {=bool:?}, pdy: {=bool:?}, puy: {=bool:?}, afsely: {=u8:?} }}" , self . modery () , self . oty () , self . pdy () , self . puy () , self . afsely ())
}
}
#[doc = "CFG5"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfg5(pub u32);
impl Cfg5 {
#[doc = "Port x pin y mode configuration"]
#[must_use]
#[inline(always)]
pub const fn modery(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Port x pin y mode configuration"]
#[inline(always)]
pub const fn set_modery(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Port x pin y output type configuration"]
#[must_use]
#[inline(always)]
pub const fn oty(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output type configuration"]
#[inline(always)]
pub const fn set_oty(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y pull down configuration"]
#[must_use]
#[inline(always)]
pub const fn pdy(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull down configuration"]
#[inline(always)]
pub const fn set_pdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y pull up configuration"]
#[must_use]
#[inline(always)]
pub const fn puy(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull up configuration"]
#[inline(always)]
pub const fn set_puy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Alternate function selection bits of port x pin y"]
#[must_use]
#[inline(always)]
pub const fn afsely(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x07;
val as u8
}
#[doc = "Alternate function selection bits of port x pin y"]
#[inline(always)]
pub const fn set_afsely(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
}
}
impl Default for Cfg5 {
#[inline(always)]
fn default() -> Cfg5 {
Cfg5(0)
}
}
impl core::fmt::Debug for Cfg5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfg5")
.field("modery", &self.modery())
.field("oty", &self.oty())
.field("pdy", &self.pdy())
.field("puy", &self.puy())
.field("afsely", &self.afsely())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfg5 {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfg5 {{ modery: {=u8:?}, oty: {=bool:?}, pdy: {=bool:?}, puy: {=bool:?}, afsely: {=u8:?} }}" , self . modery () , self . oty () , self . pdy () , self . puy () , self . afsely ())
}
}
#[doc = "CFG6"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cfg6(pub u32);
impl Cfg6 {
#[doc = "Port x pin y mode configuration"]
#[must_use]
#[inline(always)]
pub const fn modery(&self) -> u8 {
let val = (self.0 >> 0usize) & 0x03;
val as u8
}
#[doc = "Port x pin y mode configuration"]
#[inline(always)]
pub const fn set_modery(&mut self, val: u8) {
self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
}
#[doc = "Port x pin y output type configuration"]
#[must_use]
#[inline(always)]
pub const fn oty(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output type configuration"]
#[inline(always)]
pub const fn set_oty(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y pull down configuration"]
#[must_use]
#[inline(always)]
pub const fn pdy(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull down configuration"]
#[inline(always)]
pub const fn set_pdy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y pull up configuration"]
#[must_use]
#[inline(always)]
pub const fn puy(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y pull up configuration"]
#[inline(always)]
pub const fn set_puy(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Alternate function selection bits of port x pin y"]
#[must_use]
#[inline(always)]
pub const fn afsely(&self) -> u8 {
let val = (self.0 >> 8usize) & 0x07;
val as u8
}
#[doc = "Alternate function selection bits of port x pin y"]
#[inline(always)]
pub const fn set_afsely(&mut self, val: u8) {
self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
}
}
impl Default for Cfg6 {
#[inline(always)]
fn default() -> Cfg6 {
Cfg6(0)
}
}
impl core::fmt::Debug for Cfg6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Cfg6")
.field("modery", &self.modery())
.field("oty", &self.oty())
.field("pdy", &self.pdy())
.field("puy", &self.puy())
.field("afsely", &self.afsely())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Cfg6 {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Cfg6 {{ modery: {=u8:?}, oty: {=bool:?}, pdy: {=bool:?}, puy: {=bool:?}, afsely: {=u8:?} }}" , self . modery () , self . oty () , self . pdy () , self . puy () , self . afsely ())
}
}
#[doc = "IDR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Idr(pub u32);
impl Idr {
#[doc = "Port x pin y input data"]
#[must_use]
#[inline(always)]
pub const fn idr0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Port x pin y input data"]
#[inline(always)]
pub const fn set_idr0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Port x pin y input data"]
#[must_use]
#[inline(always)]
pub const fn idr1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Port x pin y input data"]
#[inline(always)]
pub const fn set_idr1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Port x pin y input data"]
#[must_use]
#[inline(always)]
pub const fn idr2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Port x pin y input data"]
#[inline(always)]
pub const fn set_idr2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Port x pin y input data"]
#[must_use]
#[inline(always)]
pub const fn idr3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Port x pin y input data"]
#[inline(always)]
pub const fn set_idr3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Port x pin y input data"]
#[must_use]
#[inline(always)]
pub const fn idr4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y input data"]
#[inline(always)]
pub const fn set_idr4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y input data"]
#[must_use]
#[inline(always)]
pub const fn idr5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y input data"]
#[inline(always)]
pub const fn set_idr5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y input data"]
#[must_use]
#[inline(always)]
pub const fn idr6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y input data"]
#[inline(always)]
pub const fn set_idr6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
}
impl Default for Idr {
#[inline(always)]
fn default() -> Idr {
Idr(0)
}
}
impl core::fmt::Debug for Idr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Idr")
.field("idr0", &self.idr0())
.field("idr1", &self.idr1())
.field("idr2", &self.idr2())
.field("idr3", &self.idr3())
.field("idr4", &self.idr4())
.field("idr5", &self.idr5())
.field("idr6", &self.idr6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Idr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Idr {{ idr0: {=bool:?}, idr1: {=bool:?}, idr2: {=bool:?}, idr3: {=bool:?}, idr4: {=bool:?}, idr5: {=bool:?}, idr6: {=bool:?} }}" , self . idr0 () , self . idr1 () , self . idr2 () , self . idr3 () , self . idr4 () , self . idr5 () , self . idr6 ())
}
}
#[doc = "LCKR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Lckr(pub u32);
impl Lckr {
#[doc = "Lock key"]
#[must_use]
#[inline(always)]
pub const fn lck0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Lock key"]
#[inline(always)]
pub const fn set_lck0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Lock key"]
#[must_use]
#[inline(always)]
pub const fn lck1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Lock key"]
#[inline(always)]
pub const fn set_lck1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Lock key"]
#[must_use]
#[inline(always)]
pub const fn lck2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Lock key"]
#[inline(always)]
pub const fn set_lck2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Lock key"]
#[must_use]
#[inline(always)]
pub const fn lck3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Lock key"]
#[inline(always)]
pub const fn set_lck3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Lock key"]
#[must_use]
#[inline(always)]
pub const fn lck4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Lock key"]
#[inline(always)]
pub const fn set_lck4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Lock key"]
#[must_use]
#[inline(always)]
pub const fn lck5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Lock key"]
#[inline(always)]
pub const fn set_lck5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Lock key"]
#[must_use]
#[inline(always)]
pub const fn lck6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Lock key"]
#[inline(always)]
pub const fn set_lck6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
#[doc = "Lock Key"]
#[must_use]
#[inline(always)]
pub const fn lckk(&self) -> u16 {
let val = (self.0 >> 16usize) & 0xffff;
val as u16
}
#[doc = "Lock Key"]
#[inline(always)]
pub const fn set_lckk(&mut self, val: u16) {
self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
}
}
impl Default for Lckr {
#[inline(always)]
fn default() -> Lckr {
Lckr(0)
}
}
impl core::fmt::Debug for Lckr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Lckr")
.field("lck0", &self.lck0())
.field("lck1", &self.lck1())
.field("lck2", &self.lck2())
.field("lck3", &self.lck3())
.field("lck4", &self.lck4())
.field("lck5", &self.lck5())
.field("lck6", &self.lck6())
.field("lckk", &self.lckk())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Lckr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Lckr {{ lck0: {=bool:?}, lck1: {=bool:?}, lck2: {=bool:?}, lck3: {=bool:?}, lck4: {=bool:?}, lck5: {=bool:?}, lck6: {=bool:?}, lckk: {=u16:?} }}" , self . lck0 () , self . lck1 () , self . lck2 () , self . lck3 () , self . lck4 () , self . lck5 () , self . lck6 () , self . lckk ())
}
}
#[doc = "ODR"]
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Odr(pub u32);
impl Odr {
#[doc = "Port x pin y output data"]
#[must_use]
#[inline(always)]
pub const fn odr0(&self) -> bool {
let val = (self.0 >> 0usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output data"]
#[inline(always)]
pub const fn set_odr0(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
}
#[doc = "Port x pin y output data"]
#[must_use]
#[inline(always)]
pub const fn odr1(&self) -> bool {
let val = (self.0 >> 1usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output data"]
#[inline(always)]
pub const fn set_odr1(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
}
#[doc = "Port x pin y output data"]
#[must_use]
#[inline(always)]
pub const fn odr2(&self) -> bool {
let val = (self.0 >> 2usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output data"]
#[inline(always)]
pub const fn set_odr2(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
}
#[doc = "Port x pin y output data"]
#[must_use]
#[inline(always)]
pub const fn odr3(&self) -> bool {
let val = (self.0 >> 3usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output data"]
#[inline(always)]
pub const fn set_odr3(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
}
#[doc = "Port x pin y output data"]
#[must_use]
#[inline(always)]
pub const fn odr4(&self) -> bool {
let val = (self.0 >> 4usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output data"]
#[inline(always)]
pub const fn set_odr4(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
}
#[doc = "Port x pin y output data"]
#[must_use]
#[inline(always)]
pub const fn odr5(&self) -> bool {
let val = (self.0 >> 5usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output data"]
#[inline(always)]
pub const fn set_odr5(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
}
#[doc = "Port x pin y output data"]
#[must_use]
#[inline(always)]
pub const fn odr6(&self) -> bool {
let val = (self.0 >> 6usize) & 0x01;
val != 0
}
#[doc = "Port x pin y output data"]
#[inline(always)]
pub const fn set_odr6(&mut self, val: bool) {
self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
}
}
impl Default for Odr {
#[inline(always)]
fn default() -> Odr {
Odr(0)
}
}
impl core::fmt::Debug for Odr {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Odr")
.field("odr0", &self.odr0())
.field("odr1", &self.odr1())
.field("odr2", &self.odr2())
.field("odr3", &self.odr3())
.field("odr4", &self.odr4())
.field("odr5", &self.odr5())
.field("odr6", &self.odr6())
.finish()
}
}
#[cfg(feature = "defmt")]
impl defmt::Format for Odr {
fn format(&self, f: defmt::Formatter) {
defmt :: write ! (f , "Odr {{ odr0: {=bool:?}, odr1: {=bool:?}, odr2: {=bool:?}, odr3: {=bool:?}, odr4: {=bool:?}, odr5: {=bool:?}, odr6: {=bool:?} }}" , self . odr0 () , self . odr1 () , self . odr2 () , self . odr3 () , self . odr4 () , self . odr5 () , self . odr6 ())
}
}