#[doc = "Reader of register PIN32"]
pub type R = crate::R<u32, super::PIN32>;
#[doc = "Writer for register PIN32"]
pub type W = crate::W<u32, super::PIN32>;
#[doc = "Register PIN32 `reset()`'s with value 0"]
impl crate::ResetValue for super::PIN32 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `PIN32_INT_ENA`"]
pub type PIN32_INT_ENA_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `PIN32_INT_ENA`"]
pub struct PIN32_INT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> PIN32_INT_ENA_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 & !(0x1f << 13)) | (((value as u32) & 0x1f) << 13);
self.w
}
}
#[doc = "Reader of field `PIN32_CONFIG`"]
pub type PIN32_CONFIG_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `PIN32_CONFIG`"]
pub struct PIN32_CONFIG_W<'a> {
w: &'a mut W,
}
impl<'a> PIN32_CONFIG_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 << 11)) | (((value as u32) & 0x03) << 11);
self.w
}
}
#[doc = "Reader of field `PIN32_WAKEUP_ENABLE`"]
pub type PIN32_WAKEUP_ENABLE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `PIN32_WAKEUP_ENABLE`"]
pub struct PIN32_WAKEUP_ENABLE_W<'a> {
w: &'a mut W,
}
impl<'a> PIN32_WAKEUP_ENABLE_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 << 10)) | (((value as u32) & 0x01) << 10);
self.w
}
}
#[doc = "Reader of field `PIN32_INT_TYPE`"]
pub type PIN32_INT_TYPE_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `PIN32_INT_TYPE`"]
pub struct PIN32_INT_TYPE_W<'a> {
w: &'a mut W,
}
impl<'a> PIN32_INT_TYPE_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 << 7)) | (((value as u32) & 0x07) << 7);
self.w
}
}
#[doc = "Reader of field `PIN32_PAD_DRIVER`"]
pub type PIN32_PAD_DRIVER_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `PIN32_PAD_DRIVER`"]
pub struct PIN32_PAD_DRIVER_W<'a> {
w: &'a mut W,
}
impl<'a> PIN32_PAD_DRIVER_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
}
}
impl R {
#[doc = "Bits 13:17"]
#[inline(always)]
pub fn pin32_int_ena(&self) -> PIN32_INT_ENA_R {
PIN32_INT_ENA_R::new(((self.bits >> 13) & 0x1f) as u8)
}
#[doc = "Bits 11:12"]
#[inline(always)]
pub fn pin32_config(&self) -> PIN32_CONFIG_R {
PIN32_CONFIG_R::new(((self.bits >> 11) & 0x03) as u8)
}
#[doc = "Bit 10"]
#[inline(always)]
pub fn pin32_wakeup_enable(&self) -> PIN32_WAKEUP_ENABLE_R {
PIN32_WAKEUP_ENABLE_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bits 7:9"]
#[inline(always)]
pub fn pin32_int_type(&self) -> PIN32_INT_TYPE_R {
PIN32_INT_TYPE_R::new(((self.bits >> 7) & 0x07) as u8)
}
#[doc = "Bit 2"]
#[inline(always)]
pub fn pin32_pad_driver(&self) -> PIN32_PAD_DRIVER_R {
PIN32_PAD_DRIVER_R::new(((self.bits >> 2) & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 13:17"]
#[inline(always)]
pub fn pin32_int_ena(&mut self) -> PIN32_INT_ENA_W {
PIN32_INT_ENA_W { w: self }
}
#[doc = "Bits 11:12"]
#[inline(always)]
pub fn pin32_config(&mut self) -> PIN32_CONFIG_W {
PIN32_CONFIG_W { w: self }
}
#[doc = "Bit 10"]
#[inline(always)]
pub fn pin32_wakeup_enable(&mut self) -> PIN32_WAKEUP_ENABLE_W {
PIN32_WAKEUP_ENABLE_W { w: self }
}
#[doc = "Bits 7:9"]
#[inline(always)]
pub fn pin32_int_type(&mut self) -> PIN32_INT_TYPE_W {
PIN32_INT_TYPE_W { w: self }
}
#[doc = "Bit 2"]
#[inline(always)]
pub fn pin32_pad_driver(&mut self) -> PIN32_PAD_DRIVER_W {
PIN32_PAD_DRIVER_W { w: self }
}
}