pub type R = crate::R<IOGCSRrs>;
pub type W = crate::W<IOGCSRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G1E {
Disabled = 0,
Enabled = 1,
}
impl From<G1E> for bool {
#[inline(always)]
fn from(variant: G1E) -> Self {
variant as u8 != 0
}
}
pub type GE_R = crate::BitReader<G1E>;
impl GE_R {
#[inline(always)]
pub const fn variant(&self) -> G1E {
match self.bits {
false => G1E::Disabled,
true => G1E::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == G1E::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == G1E::Enabled
}
}
pub type GE_W<'a, REG> = crate::BitWriter<'a, REG, G1E>;
impl<'a, REG> GE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(G1E::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(G1E::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G1S {
Ongoing = 0,
Complete = 1,
}
impl From<G1S> for bool {
#[inline(always)]
fn from(variant: G1S) -> Self {
variant as u8 != 0
}
}
pub type GS_R = crate::BitReader<G1S>;
impl GS_R {
#[inline(always)]
pub const fn variant(&self) -> G1S {
match self.bits {
false => G1S::Ongoing,
true => G1S::Complete,
}
}
#[inline(always)]
pub fn is_ongoing(&self) -> bool {
*self == G1S::Ongoing
}
#[inline(always)]
pub fn is_complete(&self) -> bool {
*self == G1S::Complete
}
}
impl R {
#[inline(always)]
pub fn ge(&self, n: u8) -> GE_R {
#[allow(clippy::no_effect)]
[(); 8][n as usize];
GE_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn ge_iter(&self) -> impl Iterator<Item = GE_R> + '_ {
(0..8).map(move |n| GE_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn g1e(&self) -> GE_R {
GE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn g2e(&self) -> GE_R {
GE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn g3e(&self) -> GE_R {
GE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn g4e(&self) -> GE_R {
GE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn g5e(&self) -> GE_R {
GE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn g6e(&self) -> GE_R {
GE_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn g7e(&self) -> GE_R {
GE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn g8e(&self) -> GE_R {
GE_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn gs(&self, n: u8) -> GS_R {
#[allow(clippy::no_effect)]
[(); 8][n as usize];
GS_R::new(((self.bits >> (n + 16)) & 1) != 0)
}
#[inline(always)]
pub fn gs_iter(&self) -> impl Iterator<Item = GS_R> + '_ {
(0..8).map(move |n| GS_R::new(((self.bits >> (n + 16)) & 1) != 0))
}
#[inline(always)]
pub fn g1s(&self) -> GS_R {
GS_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn g2s(&self) -> GS_R {
GS_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn g3s(&self) -> GS_R {
GS_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn g4s(&self) -> GS_R {
GS_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn g5s(&self) -> GS_R {
GS_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn g6s(&self) -> GS_R {
GS_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn g7s(&self) -> GS_R {
GS_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn g8s(&self) -> GS_R {
GS_R::new(((self.bits >> 23) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("IOGCSR")
.field("g1s", &self.g1s())
.field("g2s", &self.g2s())
.field("g3s", &self.g3s())
.field("g4s", &self.g4s())
.field("g5s", &self.g5s())
.field("g6s", &self.g6s())
.field("g7s", &self.g7s())
.field("g8s", &self.g8s())
.field("g1e", &self.g1e())
.field("g2e", &self.g2e())
.field("g3e", &self.g3e())
.field("g4e", &self.g4e())
.field("g5e", &self.g5e())
.field("g6e", &self.g6e())
.field("g7e", &self.g7e())
.field("g8e", &self.g8e())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ge(&mut self, n: u8) -> GE_W<IOGCSRrs> {
#[allow(clippy::no_effect)]
[(); 8][n as usize];
GE_W::new(self, n)
}
#[inline(always)]
pub fn g1e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 0)
}
#[inline(always)]
pub fn g2e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 1)
}
#[inline(always)]
pub fn g3e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 2)
}
#[inline(always)]
pub fn g4e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 3)
}
#[inline(always)]
pub fn g5e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 4)
}
#[inline(always)]
pub fn g6e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 5)
}
#[inline(always)]
pub fn g7e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 6)
}
#[inline(always)]
pub fn g8e(&mut self) -> GE_W<IOGCSRrs> {
GE_W::new(self, 7)
}
}
pub struct IOGCSRrs;
impl crate::RegisterSpec for IOGCSRrs {
type Ux = u32;
}
impl crate::Readable for IOGCSRrs {}
impl crate::Writable for IOGCSRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for IOGCSRrs {}