#[doc = "Reader of register ANDCCP"]
pub type R = crate::R<u32, super::ANDCCP>;
#[doc = "Writer for register ANDCCP"]
pub type W = crate::W<u32, super::ANDCCP>;
#[doc = "Register ANDCCP `reset()`'s with value 0"]
impl crate::ResetValue for super::ANDCCP {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `RESERVED1`"]
pub type RESERVED1_R = crate::R<u32, u32>;
#[doc = "Write proxy for field `RESERVED1`"]
pub struct RESERVED1_W<'a> {
w: &'a mut W,
}
impl<'a> RESERVED1_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u32) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x3fff_ffff << 2)) | (((value as u32) & 0x3fff_ffff) << 2);
self.w
}
}
#[doc = "Reader of field `LD_TO_EN`"]
pub type LD_TO_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `LD_TO_EN`"]
pub struct LD_TO_EN_W<'a> {
w: &'a mut W,
}
impl<'a> LD_TO_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 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "Reader of field `CCP_AND_EN`"]
pub type CCP_AND_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CCP_AND_EN`"]
pub struct CCP_AND_EN_W<'a> {
w: &'a mut W,
}
impl<'a> CCP_AND_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
}
}
impl R {
#[doc = "Bits 2:31 - 31:2\\]
Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
#[inline(always)]
pub fn reserved1(&self) -> RESERVED1_R {
RESERVED1_R::new(((self.bits >> 2) & 0x3fff_ffff) as u32)
}
#[doc = "Bit 1 - 1:1\\]
PWM assertion would happen at timeout 0: PWM assertion happens when counter matches load value 1: PWM assertion happens at timeout of the counter"]
#[inline(always)]
pub fn ld_to_en(&self) -> LD_TO_EN_R {
LD_TO_EN_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - 0:0\\]
Enables AND operation of the CCP outputs for timers A and B. 0 : PWM outputs of Timer A and Timer B are the internal generated PWM signals of the respective timers. 1 : PWM output of Timer A is ANDed version of Timer A and Timer B PWM signals and Timer B PWM ouput is Timer B PWM signal only."]
#[inline(always)]
pub fn ccp_and_en(&self) -> CCP_AND_EN_R {
CCP_AND_EN_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 2:31 - 31:2\\]
Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
#[inline(always)]
pub fn reserved1(&mut self) -> RESERVED1_W {
RESERVED1_W { w: self }
}
#[doc = "Bit 1 - 1:1\\]
PWM assertion would happen at timeout 0: PWM assertion happens when counter matches load value 1: PWM assertion happens at timeout of the counter"]
#[inline(always)]
pub fn ld_to_en(&mut self) -> LD_TO_EN_W {
LD_TO_EN_W { w: self }
}
#[doc = "Bit 0 - 0:0\\]
Enables AND operation of the CCP outputs for timers A and B. 0 : PWM outputs of Timer A and Timer B are the internal generated PWM signals of the respective timers. 1 : PWM output of Timer A is ANDed version of Timer A and Timer B PWM signals and Timer B PWM ouput is Timer B PWM signal only."]
#[inline(always)]
pub fn ccp_and_en(&mut self) -> CCP_AND_EN_W {
CCP_AND_EN_W { w: self }
}
}