bl702_pac/glb/
wifi_bt_coex_ctrl.rs

1#[doc = "Register `WIFI_BT_COEX_CTRL` reader"]
2pub struct R(crate::R<WIFI_BT_COEX_CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<WIFI_BT_COEX_CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<WIFI_BT_COEX_CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<WIFI_BT_COEX_CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `WIFI_BT_COEX_CTRL` writer"]
17pub struct W(crate::W<WIFI_BT_COEX_CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<WIFI_BT_COEX_CTRL_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<WIFI_BT_COEX_CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<WIFI_BT_COEX_CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `coex_bt_channel` reader - "]
38pub type COEX_BT_CHANNEL_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `coex_bt_channel` writer - "]
40pub type COEX_BT_CHANNEL_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, WIFI_BT_COEX_CTRL_SPEC, u8, u8, 7, O>;
42#[doc = "Field `coex_bt_pti` reader - "]
43pub type COEX_BT_PTI_R = crate::FieldReader<u8, u8>;
44#[doc = "Field `coex_bt_pti` writer - "]
45pub type COEX_BT_PTI_W<'a, const O: u8> =
46    crate::FieldWriter<'a, u32, WIFI_BT_COEX_CTRL_SPEC, u8, u8, 4, O>;
47#[doc = "Field `coex_bt_bw` reader - "]
48pub type COEX_BT_BW_R = crate::BitReader<bool>;
49#[doc = "Field `coex_bt_bw` writer - "]
50pub type COEX_BT_BW_W<'a, const O: u8> = crate::BitWriter<'a, u32, WIFI_BT_COEX_CTRL_SPEC, bool, O>;
51#[doc = "Field `en_gpio_bt_coex` reader - "]
52pub type EN_GPIO_BT_COEX_R = crate::BitReader<bool>;
53#[doc = "Field `en_gpio_bt_coex` writer - "]
54pub type EN_GPIO_BT_COEX_W<'a, const O: u8> =
55    crate::BitWriter<'a, u32, WIFI_BT_COEX_CTRL_SPEC, bool, O>;
56impl R {
57    #[doc = "Bits 0:6"]
58    #[inline(always)]
59    pub fn coex_bt_channel(&self) -> COEX_BT_CHANNEL_R {
60        COEX_BT_CHANNEL_R::new((self.bits & 0x7f) as u8)
61    }
62    #[doc = "Bits 7:10"]
63    #[inline(always)]
64    pub fn coex_bt_pti(&self) -> COEX_BT_PTI_R {
65        COEX_BT_PTI_R::new(((self.bits >> 7) & 0x0f) as u8)
66    }
67    #[doc = "Bit 11"]
68    #[inline(always)]
69    pub fn coex_bt_bw(&self) -> COEX_BT_BW_R {
70        COEX_BT_BW_R::new(((self.bits >> 11) & 1) != 0)
71    }
72    #[doc = "Bit 12"]
73    #[inline(always)]
74    pub fn en_gpio_bt_coex(&self) -> EN_GPIO_BT_COEX_R {
75        EN_GPIO_BT_COEX_R::new(((self.bits >> 12) & 1) != 0)
76    }
77}
78impl W {
79    #[doc = "Bits 0:6"]
80    #[inline(always)]
81    #[must_use]
82    pub fn coex_bt_channel(&mut self) -> COEX_BT_CHANNEL_W<0> {
83        COEX_BT_CHANNEL_W::new(self)
84    }
85    #[doc = "Bits 7:10"]
86    #[inline(always)]
87    #[must_use]
88    pub fn coex_bt_pti(&mut self) -> COEX_BT_PTI_W<7> {
89        COEX_BT_PTI_W::new(self)
90    }
91    #[doc = "Bit 11"]
92    #[inline(always)]
93    #[must_use]
94    pub fn coex_bt_bw(&mut self) -> COEX_BT_BW_W<11> {
95        COEX_BT_BW_W::new(self)
96    }
97    #[doc = "Bit 12"]
98    #[inline(always)]
99    #[must_use]
100    pub fn en_gpio_bt_coex(&mut self) -> EN_GPIO_BT_COEX_W<12> {
101        EN_GPIO_BT_COEX_W::new(self)
102    }
103    #[doc = "Writes raw bits to the register."]
104    #[inline(always)]
105    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
106        self.0.bits(bits);
107        self
108    }
109}
110#[doc = "WIFI_BT_COEX_CTRL.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wifi_bt_coex_ctrl](index.html) module"]
111pub struct WIFI_BT_COEX_CTRL_SPEC;
112impl crate::RegisterSpec for WIFI_BT_COEX_CTRL_SPEC {
113    type Ux = u32;
114}
115#[doc = "`read()` method returns [wifi_bt_coex_ctrl::R](R) reader structure"]
116impl crate::Readable for WIFI_BT_COEX_CTRL_SPEC {
117    type Reader = R;
118}
119#[doc = "`write(|w| ..)` method takes [wifi_bt_coex_ctrl::W](W) writer structure"]
120impl crate::Writable for WIFI_BT_COEX_CTRL_SPEC {
121    type Writer = W;
122    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
123    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
124}
125#[doc = "`reset()` method sets WIFI_BT_COEX_CTRL to value 0"]
126impl crate::Resettable for WIFI_BT_COEX_CTRL_SPEC {
127    const RESET_VALUE: Self::Ux = 0;
128}