efm32gg11b/pcnt0/
cmd.rs

1#[doc = "Writer for register CMD"]
2pub type W = crate::W<u32, super::CMD>;
3#[doc = "Register CMD `reset()`'s with value 0"]
4impl crate::ResetValue for super::CMD {
5    type Type = u32;
6    #[inline(always)]
7    fn reset_value() -> Self::Type { 0 }
8}
9#[doc = "Write proxy for field `LCNTIM`"]
10pub struct LCNTIM_W<'a> {
11    w: &'a mut W,
12}
13impl<'a> LCNTIM_W<'a> {
14    #[doc = r"Sets the field bit"]
15    #[inline(always)]
16    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
17    #[doc = r"Clears the field bit"]
18    #[inline(always)]
19    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub fn bit(self, value: bool) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
24        self.w
25    }
26}
27#[doc = "Write proxy for field `LTOPBIM`"]
28pub struct LTOPBIM_W<'a> {
29    w: &'a mut W,
30}
31impl<'a> LTOPBIM_W<'a> {
32    #[doc = r"Sets the field bit"]
33    #[inline(always)]
34    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
35    #[doc = r"Clears the field bit"]
36    #[inline(always)]
37    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
38    #[doc = r"Writes raw bits to the field"]
39    #[inline(always)]
40    pub fn bit(self, value: bool) -> &'a mut W {
41        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
42        self.w
43    }
44}
45impl W {
46    #[doc = "Bit 0 - Load CNT Immediately"]
47    #[inline(always)]
48    pub fn lcntim(&mut self) -> LCNTIM_W { LCNTIM_W { w: self } }
49    #[doc = "Bit 1 - Load TOPB Immediately"]
50    #[inline(always)]
51    pub fn ltopbim(&mut self) -> LTOPBIM_W { LTOPBIM_W { w: self } }
52}