1#[doc = "Reader of register CCR2"]
2pub type R = crate::R<u32, super::CCR2>;
3#[doc = "Writer for register CCR2"]
4pub type W = crate::W<u32, super::CCR2>;
5#[doc = "Register CCR2 `reset()`'s with value 0"]
6impl crate::ResetValue for super::CCR2 {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `CCR2_H`"]
14pub type CCR2_H_R = crate::R<u16, u16>;
15#[doc = "Write proxy for field `CCR2_H`"]
16pub struct CCR2_H_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> CCR2_H_W<'a> {
20 #[doc = r"Writes raw bits to the field"]
21 #[inline(always)]
22 pub unsafe fn bits(self, value: u16) -> &'a mut W {
23 self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16);
24 self.w
25 }
26}
27#[doc = "Reader of field `CCR2_L`"]
28pub type CCR2_L_R = crate::R<u16, u16>;
29#[doc = "Write proxy for field `CCR2_L`"]
30pub struct CCR2_L_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> CCR2_L_W<'a> {
34 #[doc = r"Writes raw bits to the field"]
35 #[inline(always)]
36 pub unsafe fn bits(self, value: u16) -> &'a mut W {
37 self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff);
38 self.w
39 }
40}
41impl R {
42 #[doc = "Bits 16:31 - High Capture/Compare 2 value (TIM2 only)"]
43 #[inline(always)]
44 pub fn ccr2_h(&self) -> CCR2_H_R {
45 CCR2_H_R::new(((self.bits >> 16) & 0xffff) as u16)
46 }
47 #[doc = "Bits 0:15 - Low Capture/Compare 2 value"]
48 #[inline(always)]
49 pub fn ccr2_l(&self) -> CCR2_L_R {
50 CCR2_L_R::new((self.bits & 0xffff) as u16)
51 }
52}
53impl W {
54 #[doc = "Bits 16:31 - High Capture/Compare 2 value (TIM2 only)"]
55 #[inline(always)]
56 pub fn ccr2_h(&mut self) -> CCR2_H_W {
57 CCR2_H_W { w: self }
58 }
59 #[doc = "Bits 0:15 - Low Capture/Compare 2 value"]
60 #[inline(always)]
61 pub fn ccr2_l(&mut self) -> CCR2_L_W {
62 CCR2_L_W { w: self }
63 }
64}