#[doc = "Register `SIO` reader"]
pub struct R(crate::R<SIO_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SIO_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<SIO_SPEC>> for R {
    fn from(reader: crate::R<SIO_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `SIO` writer"]
pub struct W(crate::W<SIO_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SIO_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl core::convert::From<crate::W<SIO_SPEC>> for W {
    fn from(writer: crate::W<SIO_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `PAIR_VREG01_EN` reader - Selects output buffer mode:?0: unregulated output buffer?1: regulated output buffer"]
pub struct PAIR_VREG01_EN_R(crate::FieldReader<bool, bool>);
impl PAIR_VREG01_EN_R {
    pub(crate) fn new(bits: bool) -> Self {
        PAIR_VREG01_EN_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PAIR_VREG01_EN_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PAIR_VREG01_EN` writer - Selects output buffer mode:?0: unregulated output buffer?1: regulated output buffer"]
pub struct PAIR_VREG01_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> PAIR_VREG01_EN_W<'a> {
    #[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 = (self.w.bits & !0x01) | (value as u32 & 0x01);
        self.w
    }
}
#[doc = "Field `PAIR_IBUF01_SEL` reader - Selects input buffer mode:?0: singled ended input buffer?1: differential input buffer"]
pub struct PAIR_IBUF01_SEL_R(crate::FieldReader<bool, bool>);
impl PAIR_IBUF01_SEL_R {
    pub(crate) fn new(bits: bool) -> Self {
        PAIR_IBUF01_SEL_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PAIR_IBUF01_SEL_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PAIR_IBUF01_SEL` writer - Selects input buffer mode:?0: singled ended input buffer?1: differential input buffer"]
pub struct PAIR_IBUF01_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> PAIR_IBUF01_SEL_W<'a> {
    #[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 = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
        self.w
    }
}
#[doc = "Field `PAIR_VTRIP01_SEL` reader - Selects trip-point of input buffer. In single ended input buffer mode (IBUF01_SEL = '0'):?0: input buffer functions as a CMOS input buffer.?1: input buffer functions as a LVTTL input buffer.?In differential input buffer mode (IBUF01_SEL = '1')?'0': trip-point is 0.5*Vddio or 0.5*Voh (depends on VREF_SEL/VOH_SEL)?'1': trip-point is 0.4*Vddio or 1.0*Vref (depends on VREF_SEL)??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
pub struct PAIR_VTRIP01_SEL_R(crate::FieldReader<bool, bool>);
impl PAIR_VTRIP01_SEL_R {
    pub(crate) fn new(bits: bool) -> Self {
        PAIR_VTRIP01_SEL_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PAIR_VTRIP01_SEL_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PAIR_VTRIP01_SEL` writer - Selects trip-point of input buffer. In single ended input buffer mode (IBUF01_SEL = '0'):?0: input buffer functions as a CMOS input buffer.?1: input buffer functions as a LVTTL input buffer.?In differential input buffer mode (IBUF01_SEL = '1')?'0': trip-point is 0.5*Vddio or 0.5*Voh (depends on VREF_SEL/VOH_SEL)?'1': trip-point is 0.4*Vddio or 1.0*Vref (depends on VREF_SEL)??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
pub struct PAIR_VTRIP01_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> PAIR_VTRIP01_SEL_W<'a> {
    #[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 = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
        self.w
    }
}
#[doc = "Field `PAIR_VREF01_SEL` reader - Selects reference voltage Vref for trip-point of input buffer:?0: trip-point reference of SRSS internal referece Vref (1.2V)?1: trip-point reference of SRSS internal referece Vref (1.2V)?2: trip-point reference of AMUXBUS_A?3: trip-point reference of AMUXBUS_B??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
pub struct PAIR_VREF01_SEL_R(crate::FieldReader<u8, u8>);
impl PAIR_VREF01_SEL_R {
    pub(crate) fn new(bits: u8) -> Self {
        PAIR_VREF01_SEL_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PAIR_VREF01_SEL_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PAIR_VREF01_SEL` writer - Selects reference voltage Vref for trip-point of input buffer:?0: trip-point reference of SRSS internal referece Vref (1.2V)?1: trip-point reference of SRSS internal referece Vref (1.2V)?2: trip-point reference of AMUXBUS_A?3: trip-point reference of AMUXBUS_B??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
pub struct PAIR_VREF01_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> PAIR_VREF01_SEL_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 3)) | ((value as u32 & 0x03) << 3);
        self.w
    }
}
#[doc = "Field `PAIR_VOH01_SEL` reader - Selects regulated Voh output level and trip point of input buffer for a specific SIO pin pair. Voh depends on the selected reference voltage (VREF_SEL). ?0: Voh = 1*reference; e.g. reference at 1.2V -> Voh = 1.2V ?1: Voh = 1.25*reference; e.g. reference at 1.2V -> Voh = 1.5V?2: Voh = 1.49*reference; e.g. reference at 1.2V -> Voh = ~1.8V?3: Voh = 1.67*reference; e.g. reference at 1.2V -> Voh = 2V?4: Voh = 2.08*reference; e.g. reference at 1.2V -> Voh = 2.5V?5: Voh = 2.5*reference; e.g. reference at 1.2V -> Voh = 3V?6: Voh = 2.78*reference; e.g. reference at 1.2V -> Voh = ~3.3V?7: Voh = 4.16*reference; e.g. reference at 1.2V -> Voh = 5.0V?Note: The upper value on VOH is limited to Vddio ? 400mV"]
pub struct PAIR_VOH01_SEL_R(crate::FieldReader<u8, u8>);
impl PAIR_VOH01_SEL_R {
    pub(crate) fn new(bits: u8) -> Self {
        PAIR_VOH01_SEL_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PAIR_VOH01_SEL_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PAIR_VOH01_SEL` writer - Selects regulated Voh output level and trip point of input buffer for a specific SIO pin pair. Voh depends on the selected reference voltage (VREF_SEL). ?0: Voh = 1*reference; e.g. reference at 1.2V -> Voh = 1.2V ?1: Voh = 1.25*reference; e.g. reference at 1.2V -> Voh = 1.5V?2: Voh = 1.49*reference; e.g. reference at 1.2V -> Voh = ~1.8V?3: Voh = 1.67*reference; e.g. reference at 1.2V -> Voh = 2V?4: Voh = 2.08*reference; e.g. reference at 1.2V -> Voh = 2.5V?5: Voh = 2.5*reference; e.g. reference at 1.2V -> Voh = 3V?6: Voh = 2.78*reference; e.g. reference at 1.2V -> Voh = ~3.3V?7: Voh = 4.16*reference; e.g. reference at 1.2V -> Voh = 5.0V?Note: The upper value on VOH is limited to Vddio ? 400mV"]
pub struct PAIR_VOH01_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> PAIR_VOH01_SEL_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 5)) | ((value as u32 & 0x07) << 5);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - Selects output buffer mode:?0: unregulated output buffer?1: regulated output buffer"]
    #[inline(always)]
    pub fn pair_vreg01_en(&self) -> PAIR_VREG01_EN_R {
        PAIR_VREG01_EN_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - Selects input buffer mode:?0: singled ended input buffer?1: differential input buffer"]
    #[inline(always)]
    pub fn pair_ibuf01_sel(&self) -> PAIR_IBUF01_SEL_R {
        PAIR_IBUF01_SEL_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - Selects trip-point of input buffer. In single ended input buffer mode (IBUF01_SEL = '0'):?0: input buffer functions as a CMOS input buffer.?1: input buffer functions as a LVTTL input buffer.?In differential input buffer mode (IBUF01_SEL = '1')?'0': trip-point is 0.5*Vddio or 0.5*Voh (depends on VREF_SEL/VOH_SEL)?'1': trip-point is 0.4*Vddio or 1.0*Vref (depends on VREF_SEL)??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
    #[inline(always)]
    pub fn pair_vtrip01_sel(&self) -> PAIR_VTRIP01_SEL_R {
        PAIR_VTRIP01_SEL_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bits 3:4 - Selects reference voltage Vref for trip-point of input buffer:?0: trip-point reference of SRSS internal referece Vref (1.2V)?1: trip-point reference of SRSS internal referece Vref (1.2V)?2: trip-point reference of AMUXBUS_A?3: trip-point reference of AMUXBUS_B??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
    #[inline(always)]
    pub fn pair_vref01_sel(&self) -> PAIR_VREF01_SEL_R {
        PAIR_VREF01_SEL_R::new(((self.bits >> 3) & 0x03) as u8)
    }
    #[doc = "Bits 5:7 - Selects regulated Voh output level and trip point of input buffer for a specific SIO pin pair. Voh depends on the selected reference voltage (VREF_SEL). ?0: Voh = 1*reference; e.g. reference at 1.2V -> Voh = 1.2V ?1: Voh = 1.25*reference; e.g. reference at 1.2V -> Voh = 1.5V?2: Voh = 1.49*reference; e.g. reference at 1.2V -> Voh = ~1.8V?3: Voh = 1.67*reference; e.g. reference at 1.2V -> Voh = 2V?4: Voh = 2.08*reference; e.g. reference at 1.2V -> Voh = 2.5V?5: Voh = 2.5*reference; e.g. reference at 1.2V -> Voh = 3V?6: Voh = 2.78*reference; e.g. reference at 1.2V -> Voh = ~3.3V?7: Voh = 4.16*reference; e.g. reference at 1.2V -> Voh = 5.0V?Note: The upper value on VOH is limited to Vddio ? 400mV"]
    #[inline(always)]
    pub fn pair_voh01_sel(&self) -> PAIR_VOH01_SEL_R {
        PAIR_VOH01_SEL_R::new(((self.bits >> 5) & 0x07) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - Selects output buffer mode:?0: unregulated output buffer?1: regulated output buffer"]
    #[inline(always)]
    pub fn pair_vreg01_en(&mut self) -> PAIR_VREG01_EN_W {
        PAIR_VREG01_EN_W { w: self }
    }
    #[doc = "Bit 1 - Selects input buffer mode:?0: singled ended input buffer?1: differential input buffer"]
    #[inline(always)]
    pub fn pair_ibuf01_sel(&mut self) -> PAIR_IBUF01_SEL_W {
        PAIR_IBUF01_SEL_W { w: self }
    }
    #[doc = "Bit 2 - Selects trip-point of input buffer. In single ended input buffer mode (IBUF01_SEL = '0'):?0: input buffer functions as a CMOS input buffer.?1: input buffer functions as a LVTTL input buffer.?In differential input buffer mode (IBUF01_SEL = '1')?'0': trip-point is 0.5*Vddio or 0.5*Voh (depends on VREF_SEL/VOH_SEL)?'1': trip-point is 0.4*Vddio or 1.0*Vref (depends on VREF_SEL)??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
    #[inline(always)]
    pub fn pair_vtrip01_sel(&mut self) -> PAIR_VTRIP01_SEL_W {
        PAIR_VTRIP01_SEL_W { w: self }
    }
    #[doc = "Bits 3:4 - Selects reference voltage Vref for trip-point of input buffer:?0: trip-point reference of SRSS internal referece Vref (1.2V)?1: trip-point reference of SRSS internal referece Vref (1.2V)?2: trip-point reference of AMUXBUS_A?3: trip-point reference of AMUXBUS_B??Please refer to s8iom0s8 BROS 001-70428, section 4.2.7 for more details."]
    #[inline(always)]
    pub fn pair_vref01_sel(&mut self) -> PAIR_VREF01_SEL_W {
        PAIR_VREF01_SEL_W { w: self }
    }
    #[doc = "Bits 5:7 - Selects regulated Voh output level and trip point of input buffer for a specific SIO pin pair. Voh depends on the selected reference voltage (VREF_SEL). ?0: Voh = 1*reference; e.g. reference at 1.2V -> Voh = 1.2V ?1: Voh = 1.25*reference; e.g. reference at 1.2V -> Voh = 1.5V?2: Voh = 1.49*reference; e.g. reference at 1.2V -> Voh = ~1.8V?3: Voh = 1.67*reference; e.g. reference at 1.2V -> Voh = 2V?4: Voh = 2.08*reference; e.g. reference at 1.2V -> Voh = 2.5V?5: Voh = 2.5*reference; e.g. reference at 1.2V -> Voh = 3V?6: Voh = 2.78*reference; e.g. reference at 1.2V -> Voh = ~3.3V?7: Voh = 4.16*reference; e.g. reference at 1.2V -> Voh = 5.0V?Note: The upper value on VOH is limited to Vddio ? 400mV"]
    #[inline(always)]
    pub fn pair_voh01_sel(&mut self) -> PAIR_VOH01_SEL_W {
        PAIR_VOH01_SEL_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Port SIO configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sio](index.html) module"]
pub struct SIO_SPEC;
impl crate::RegisterSpec for SIO_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [sio::R](R) reader structure"]
impl crate::Readable for SIO_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [sio::W](W) writer structure"]
impl crate::Writable for SIO_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets SIO to value 0"]
impl crate::Resettable for SIO_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
