#[doc = "Reader of register CTRL"]
pub type R = crate::R<u32, super::CTRL>;
#[doc = "Writer for register CTRL"]
pub type W = crate::W<u32, super::CTRL>;
#[doc = "Register CTRL `reset()`'s with value 0"]
impl crate::ResetValue for super::CTRL {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `RX_LSB_FIRST`"]
pub type RX_LSB_FIRST_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RX_LSB_FIRST`"]
pub struct RX_LSB_FIRST_W<'a> {
w: &'a mut W,
}
impl<'a> RX_LSB_FIRST_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 << 7)) | (((value as u32) & 0x01) << 7);
self.w
}
}
#[doc = "Reader of field `TX_LSB_FIRST`"]
pub type TX_LSB_FIRST_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TX_LSB_FIRST`"]
pub struct TX_LSB_FIRST_W<'a> {
w: &'a mut W,
}
impl<'a> TX_LSB_FIRST_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 << 6)) | (((value as u32) & 0x01) << 6);
self.w
}
}
#[doc = "Reader of field `TRANS_START`"]
pub type TRANS_START_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TRANS_START`"]
pub struct TRANS_START_W<'a> {
w: &'a mut W,
}
impl<'a> TRANS_START_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 << 5)) | (((value as u32) & 0x01) << 5);
self.w
}
}
#[doc = "Reader of field `MS_MODE`"]
pub type MS_MODE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `MS_MODE`"]
pub struct MS_MODE_W<'a> {
w: &'a mut W,
}
impl<'a> MS_MODE_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 << 4)) | (((value as u32) & 0x01) << 4);
self.w
}
}
#[doc = "Reader of field `SCL_FORCE_OUT`"]
pub type SCL_FORCE_OUT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SCL_FORCE_OUT`"]
pub struct SCL_FORCE_OUT_W<'a> {
w: &'a mut W,
}
impl<'a> SCL_FORCE_OUT_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 = "Reader of field `SDA_FORCE_OUT`"]
pub type SDA_FORCE_OUT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SDA_FORCE_OUT`"]
pub struct SDA_FORCE_OUT_W<'a> {
w: &'a mut W,
}
impl<'a> SDA_FORCE_OUT_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
}
}
impl R {
#[doc = "Bit 7"]
#[inline(always)]
pub fn rx_lsb_first(&self) -> RX_LSB_FIRST_R {
RX_LSB_FIRST_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 6"]
#[inline(always)]
pub fn tx_lsb_first(&self) -> TX_LSB_FIRST_R {
TX_LSB_FIRST_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 5"]
#[inline(always)]
pub fn trans_start(&self) -> TRANS_START_R {
TRANS_START_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 4"]
#[inline(always)]
pub fn ms_mode(&self) -> MS_MODE_R {
MS_MODE_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 1"]
#[inline(always)]
pub fn scl_force_out(&self) -> SCL_FORCE_OUT_R {
SCL_FORCE_OUT_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0"]
#[inline(always)]
pub fn sda_force_out(&self) -> SDA_FORCE_OUT_R {
SDA_FORCE_OUT_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 7"]
#[inline(always)]
pub fn rx_lsb_first(&mut self) -> RX_LSB_FIRST_W {
RX_LSB_FIRST_W { w: self }
}
#[doc = "Bit 6"]
#[inline(always)]
pub fn tx_lsb_first(&mut self) -> TX_LSB_FIRST_W {
TX_LSB_FIRST_W { w: self }
}
#[doc = "Bit 5"]
#[inline(always)]
pub fn trans_start(&mut self) -> TRANS_START_W {
TRANS_START_W { w: self }
}
#[doc = "Bit 4"]
#[inline(always)]
pub fn ms_mode(&mut self) -> MS_MODE_W {
MS_MODE_W { w: self }
}
#[doc = "Bit 1"]
#[inline(always)]
pub fn scl_force_out(&mut self) -> SCL_FORCE_OUT_W {
SCL_FORCE_OUT_W { w: self }
}
#[doc = "Bit 0"]
#[inline(always)]
pub fn sda_force_out(&mut self) -> SDA_FORCE_OUT_W {
SDA_FORCE_OUT_W { w: self }
}
}