pub type R = crate::R<TRIGCTRLrs>;
pub type W = crate::W<TRIGCTRLrs>;
pub type RxtenR = crate::BitReader;
pub type RxtenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type TxtenR = crate::BitReader;
pub type TxtenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AutotxtenR = crate::BitReader;
pub type AutotxtenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Txarx0enR = crate::BitReader;
pub type Txarx0enW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Txarx1enR = crate::BitReader;
pub type Txarx1enW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Txarx2enR = crate::BitReader;
pub type Txarx2enW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Rxatx0enR = crate::BitReader;
pub type Rxatx0enW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Rxatx1enR = crate::BitReader;
pub type Rxatx1enW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Rxatx2enR = crate::BitReader;
pub type Rxatx2enW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TSEL {
Prsch0 = 0,
Prsch1 = 1,
Prsch2 = 2,
Prsch3 = 3,
Prsch4 = 4,
Prsch5 = 5,
Prsch6 = 6,
Prsch7 = 7,
Prsch8 = 8,
Prsch9 = 9,
Prsch10 = 10,
Prsch11 = 11,
}
impl From<TSEL> for u8 {
#[inline(always)]
fn from(variant: TSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for TSEL {
type Ux = u8;
}
impl crate::IsEnum for TSEL {}
pub type TselR = crate::FieldReader<TSEL>;
impl TselR {
#[inline(always)]
pub const fn variant(&self) -> Option<TSEL> {
match self.bits {
0 => Some(TSEL::Prsch0),
1 => Some(TSEL::Prsch1),
2 => Some(TSEL::Prsch2),
3 => Some(TSEL::Prsch3),
4 => Some(TSEL::Prsch4),
5 => Some(TSEL::Prsch5),
6 => Some(TSEL::Prsch6),
7 => Some(TSEL::Prsch7),
8 => Some(TSEL::Prsch8),
9 => Some(TSEL::Prsch9),
10 => Some(TSEL::Prsch10),
11 => Some(TSEL::Prsch11),
_ => None,
}
}
#[inline(always)]
pub fn is_prsch0(&self) -> bool {
*self == TSEL::Prsch0
}
#[inline(always)]
pub fn is_prsch1(&self) -> bool {
*self == TSEL::Prsch1
}
#[inline(always)]
pub fn is_prsch2(&self) -> bool {
*self == TSEL::Prsch2
}
#[inline(always)]
pub fn is_prsch3(&self) -> bool {
*self == TSEL::Prsch3
}
#[inline(always)]
pub fn is_prsch4(&self) -> bool {
*self == TSEL::Prsch4
}
#[inline(always)]
pub fn is_prsch5(&self) -> bool {
*self == TSEL::Prsch5
}
#[inline(always)]
pub fn is_prsch6(&self) -> bool {
*self == TSEL::Prsch6
}
#[inline(always)]
pub fn is_prsch7(&self) -> bool {
*self == TSEL::Prsch7
}
#[inline(always)]
pub fn is_prsch8(&self) -> bool {
*self == TSEL::Prsch8
}
#[inline(always)]
pub fn is_prsch9(&self) -> bool {
*self == TSEL::Prsch9
}
#[inline(always)]
pub fn is_prsch10(&self) -> bool {
*self == TSEL::Prsch10
}
#[inline(always)]
pub fn is_prsch11(&self) -> bool {
*self == TSEL::Prsch11
}
}
pub type TselW<'a, REG> = crate::FieldWriter<'a, REG, 4, TSEL>;
impl<'a, REG> TselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn prsch0(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch0)
}
#[inline(always)]
pub fn prsch1(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch1)
}
#[inline(always)]
pub fn prsch2(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch2)
}
#[inline(always)]
pub fn prsch3(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch3)
}
#[inline(always)]
pub fn prsch4(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch4)
}
#[inline(always)]
pub fn prsch5(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch5)
}
#[inline(always)]
pub fn prsch6(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch6)
}
#[inline(always)]
pub fn prsch7(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch7)
}
#[inline(always)]
pub fn prsch8(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch8)
}
#[inline(always)]
pub fn prsch9(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch9)
}
#[inline(always)]
pub fn prsch10(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch10)
}
#[inline(always)]
pub fn prsch11(self) -> &'a mut crate::W<REG> {
self.variant(TSEL::Prsch11)
}
}
impl R {
#[inline(always)]
pub fn rxten(&self) -> RxtenR {
RxtenR::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn txten(&self) -> TxtenR {
TxtenR::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn autotxten(&self) -> AutotxtenR {
AutotxtenR::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn txarx0en(&self) -> Txarx0enR {
Txarx0enR::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn txarx1en(&self) -> Txarx1enR {
Txarx1enR::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn txarx2en(&self) -> Txarx2enR {
Txarx2enR::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn rxatx0en(&self) -> Rxatx0enR {
Rxatx0enR::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn rxatx1en(&self) -> Rxatx1enR {
Rxatx1enR::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn rxatx2en(&self) -> Rxatx2enR {
Rxatx2enR::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn tsel(&self) -> TselR {
TselR::new(((self.bits >> 16) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TRIGCTRL")
.field("rxten", &self.rxten())
.field("txten", &self.txten())
.field("autotxten", &self.autotxten())
.field("txarx0en", &self.txarx0en())
.field("txarx1en", &self.txarx1en())
.field("txarx2en", &self.txarx2en())
.field("rxatx0en", &self.rxatx0en())
.field("rxatx1en", &self.rxatx1en())
.field("rxatx2en", &self.rxatx2en())
.field("tsel", &self.tsel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rxten(&mut self) -> RxtenW<'_, TRIGCTRLrs> {
RxtenW::new(self, 4)
}
#[inline(always)]
pub fn txten(&mut self) -> TxtenW<'_, TRIGCTRLrs> {
TxtenW::new(self, 5)
}
#[inline(always)]
pub fn autotxten(&mut self) -> AutotxtenW<'_, TRIGCTRLrs> {
AutotxtenW::new(self, 6)
}
#[inline(always)]
pub fn txarx0en(&mut self) -> Txarx0enW<'_, TRIGCTRLrs> {
Txarx0enW::new(self, 7)
}
#[inline(always)]
pub fn txarx1en(&mut self) -> Txarx1enW<'_, TRIGCTRLrs> {
Txarx1enW::new(self, 8)
}
#[inline(always)]
pub fn txarx2en(&mut self) -> Txarx2enW<'_, TRIGCTRLrs> {
Txarx2enW::new(self, 9)
}
#[inline(always)]
pub fn rxatx0en(&mut self) -> Rxatx0enW<'_, TRIGCTRLrs> {
Rxatx0enW::new(self, 10)
}
#[inline(always)]
pub fn rxatx1en(&mut self) -> Rxatx1enW<'_, TRIGCTRLrs> {
Rxatx1enW::new(self, 11)
}
#[inline(always)]
pub fn rxatx2en(&mut self) -> Rxatx2enW<'_, TRIGCTRLrs> {
Rxatx2enW::new(self, 12)
}
#[inline(always)]
pub fn tsel(&mut self) -> TselW<'_, TRIGCTRLrs> {
TselW::new(self, 16)
}
}
pub struct TRIGCTRLrs;
impl crate::RegisterSpec for TRIGCTRLrs {
type Ux = u32;
}
impl crate::Readable for TRIGCTRLrs {}
impl crate::Writable for TRIGCTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for TRIGCTRLrs {}