bl702_pac/glb/
bz_coex_ctrl.rs

1#[doc = "Register `BZ_COEX_CTRL` reader"]
2pub struct R(crate::R<BZ_COEX_CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<BZ_COEX_CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<BZ_COEX_CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<BZ_COEX_CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `BZ_COEX_CTRL` writer"]
17pub struct W(crate::W<BZ_COEX_CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<BZ_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<BZ_COEX_CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<BZ_COEX_CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `coex_en` reader - "]
38pub type COEX_EN_R = crate::BitReader<bool>;
39#[doc = "Field `coex_en` writer - "]
40pub type COEX_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
41#[doc = "Field `wlan_en` reader - "]
42pub type WLAN_EN_R = crate::BitReader<bool>;
43#[doc = "Field `wlan_en` writer - "]
44pub type WLAN_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
45#[doc = "Field `ble_rx_ignore` reader - "]
46pub type BLE_RX_IGNORE_R = crate::BitReader<bool>;
47#[doc = "Field `ble_rx_ignore` writer - "]
48pub type BLE_RX_IGNORE_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
49#[doc = "Field `m154_rx_ignore` reader - "]
50pub type M154_RX_IGNORE_R = crate::BitReader<bool>;
51#[doc = "Field `m154_rx_ignore` writer - "]
52pub type M154_RX_IGNORE_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
53#[doc = "Field `bz_pri_thr` reader - "]
54pub type BZ_PRI_THR_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `bz_pri_thr` writer - "]
56pub type BZ_PRI_THR_W<'a, const O: u8> =
57    crate::FieldWriter<'a, u32, BZ_COEX_CTRL_SPEC, u8, u8, 4, O>;
58#[doc = "Field `bz_pri_en` reader - "]
59pub type BZ_PRI_EN_R = crate::BitReader<bool>;
60#[doc = "Field `bz_pri_en` writer - "]
61pub type BZ_PRI_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
62#[doc = "Field `bz_pri_pol` reader - "]
63pub type BZ_PRI_POL_R = crate::BitReader<bool>;
64#[doc = "Field `bz_pri_pol` writer - "]
65pub type BZ_PRI_POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
66#[doc = "Field `bz_active_pol` reader - "]
67pub type BZ_ACTIVE_POL_R = crate::BitReader<bool>;
68#[doc = "Field `bz_active_pol` writer - "]
69pub type BZ_ACTIVE_POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
70#[doc = "Field `bz_abort_pol` reader - "]
71pub type BZ_ABORT_POL_R = crate::BitReader<bool>;
72#[doc = "Field `bz_abort_pol` writer - "]
73pub type BZ_ABORT_POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
74#[doc = "Field `coex_pri` reader - "]
75pub type COEX_PRI_R = crate::BitReader<bool>;
76#[doc = "Field `coex_pri` writer - "]
77pub type COEX_PRI_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
78#[doc = "Field `force_m154_win` reader - "]
79pub type FORCE_M154_WIN_R = crate::BitReader<bool>;
80#[doc = "Field `force_m154_win` writer - "]
81pub type FORCE_M154_WIN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
82#[doc = "Field `force_ble_win` reader - "]
83pub type FORCE_BLE_WIN_R = crate::BitReader<bool>;
84#[doc = "Field `force_ble_win` writer - "]
85pub type FORCE_BLE_WIN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
86#[doc = "Field `coex_option` reader - "]
87pub type COEX_OPTION_R = crate::BitReader<bool>;
88#[doc = "Field `coex_option` writer - "]
89pub type COEX_OPTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
90#[doc = "Field `coex_force_ch` reader - "]
91pub type COEX_FORCE_CH_R = crate::FieldReader<u8, u8>;
92#[doc = "Field `coex_force_ch` writer - "]
93pub type COEX_FORCE_CH_W<'a, const O: u8> =
94    crate::FieldWriter<'a, u32, BZ_COEX_CTRL_SPEC, u8, u8, 7, O>;
95#[doc = "Field `m154_rx_abort_dis` reader - "]
96pub type M154_RX_ABORT_DIS_R = crate::BitReader<bool>;
97#[doc = "Field `m154_rx_abort_dis` writer - "]
98pub type M154_RX_ABORT_DIS_W<'a, const O: u8> =
99    crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
100#[doc = "Field `m154_tx_abort_dis` reader - "]
101pub type M154_TX_ABORT_DIS_R = crate::BitReader<bool>;
102#[doc = "Field `m154_tx_abort_dis` writer - "]
103pub type M154_TX_ABORT_DIS_W<'a, const O: u8> =
104    crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
105#[doc = "Field `ble_rx_abort_dis` reader - "]
106pub type BLE_RX_ABORT_DIS_R = crate::BitReader<bool>;
107#[doc = "Field `ble_rx_abort_dis` writer - "]
108pub type BLE_RX_ABORT_DIS_W<'a, const O: u8> =
109    crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
110#[doc = "Field `ble_tx_abort_dis` reader - "]
111pub type BLE_TX_ABORT_DIS_R = crate::BitReader<bool>;
112#[doc = "Field `ble_tx_abort_dis` writer - "]
113pub type BLE_TX_ABORT_DIS_W<'a, const O: u8> =
114    crate::BitWriter<'a, u32, BZ_COEX_CTRL_SPEC, bool, O>;
115#[doc = "Field `coex_arb` reader - "]
116pub type COEX_ARB_R = crate::FieldReader<u8, u8>;
117#[doc = "Field `coex_arb` writer - "]
118pub type COEX_ARB_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BZ_COEX_CTRL_SPEC, u8, u8, 4, O>;
119impl R {
120    #[doc = "Bit 0"]
121    #[inline(always)]
122    pub fn coex_en(&self) -> COEX_EN_R {
123        COEX_EN_R::new((self.bits & 1) != 0)
124    }
125    #[doc = "Bit 1"]
126    #[inline(always)]
127    pub fn wlan_en(&self) -> WLAN_EN_R {
128        WLAN_EN_R::new(((self.bits >> 1) & 1) != 0)
129    }
130    #[doc = "Bit 2"]
131    #[inline(always)]
132    pub fn ble_rx_ignore(&self) -> BLE_RX_IGNORE_R {
133        BLE_RX_IGNORE_R::new(((self.bits >> 2) & 1) != 0)
134    }
135    #[doc = "Bit 3"]
136    #[inline(always)]
137    pub fn m154_rx_ignore(&self) -> M154_RX_IGNORE_R {
138        M154_RX_IGNORE_R::new(((self.bits >> 3) & 1) != 0)
139    }
140    #[doc = "Bits 4:7"]
141    #[inline(always)]
142    pub fn bz_pri_thr(&self) -> BZ_PRI_THR_R {
143        BZ_PRI_THR_R::new(((self.bits >> 4) & 0x0f) as u8)
144    }
145    #[doc = "Bit 8"]
146    #[inline(always)]
147    pub fn bz_pri_en(&self) -> BZ_PRI_EN_R {
148        BZ_PRI_EN_R::new(((self.bits >> 8) & 1) != 0)
149    }
150    #[doc = "Bit 9"]
151    #[inline(always)]
152    pub fn bz_pri_pol(&self) -> BZ_PRI_POL_R {
153        BZ_PRI_POL_R::new(((self.bits >> 9) & 1) != 0)
154    }
155    #[doc = "Bit 10"]
156    #[inline(always)]
157    pub fn bz_active_pol(&self) -> BZ_ACTIVE_POL_R {
158        BZ_ACTIVE_POL_R::new(((self.bits >> 10) & 1) != 0)
159    }
160    #[doc = "Bit 11"]
161    #[inline(always)]
162    pub fn bz_abort_pol(&self) -> BZ_ABORT_POL_R {
163        BZ_ABORT_POL_R::new(((self.bits >> 11) & 1) != 0)
164    }
165    #[doc = "Bit 12"]
166    #[inline(always)]
167    pub fn coex_pri(&self) -> COEX_PRI_R {
168        COEX_PRI_R::new(((self.bits >> 12) & 1) != 0)
169    }
170    #[doc = "Bit 13"]
171    #[inline(always)]
172    pub fn force_m154_win(&self) -> FORCE_M154_WIN_R {
173        FORCE_M154_WIN_R::new(((self.bits >> 13) & 1) != 0)
174    }
175    #[doc = "Bit 14"]
176    #[inline(always)]
177    pub fn force_ble_win(&self) -> FORCE_BLE_WIN_R {
178        FORCE_BLE_WIN_R::new(((self.bits >> 14) & 1) != 0)
179    }
180    #[doc = "Bit 15"]
181    #[inline(always)]
182    pub fn coex_option(&self) -> COEX_OPTION_R {
183        COEX_OPTION_R::new(((self.bits >> 15) & 1) != 0)
184    }
185    #[doc = "Bits 16:22"]
186    #[inline(always)]
187    pub fn coex_force_ch(&self) -> COEX_FORCE_CH_R {
188        COEX_FORCE_CH_R::new(((self.bits >> 16) & 0x7f) as u8)
189    }
190    #[doc = "Bit 24"]
191    #[inline(always)]
192    pub fn m154_rx_abort_dis(&self) -> M154_RX_ABORT_DIS_R {
193        M154_RX_ABORT_DIS_R::new(((self.bits >> 24) & 1) != 0)
194    }
195    #[doc = "Bit 25"]
196    #[inline(always)]
197    pub fn m154_tx_abort_dis(&self) -> M154_TX_ABORT_DIS_R {
198        M154_TX_ABORT_DIS_R::new(((self.bits >> 25) & 1) != 0)
199    }
200    #[doc = "Bit 26"]
201    #[inline(always)]
202    pub fn ble_rx_abort_dis(&self) -> BLE_RX_ABORT_DIS_R {
203        BLE_RX_ABORT_DIS_R::new(((self.bits >> 26) & 1) != 0)
204    }
205    #[doc = "Bit 27"]
206    #[inline(always)]
207    pub fn ble_tx_abort_dis(&self) -> BLE_TX_ABORT_DIS_R {
208        BLE_TX_ABORT_DIS_R::new(((self.bits >> 27) & 1) != 0)
209    }
210    #[doc = "Bits 28:31"]
211    #[inline(always)]
212    pub fn coex_arb(&self) -> COEX_ARB_R {
213        COEX_ARB_R::new(((self.bits >> 28) & 0x0f) as u8)
214    }
215}
216impl W {
217    #[doc = "Bit 0"]
218    #[inline(always)]
219    #[must_use]
220    pub fn coex_en(&mut self) -> COEX_EN_W<0> {
221        COEX_EN_W::new(self)
222    }
223    #[doc = "Bit 1"]
224    #[inline(always)]
225    #[must_use]
226    pub fn wlan_en(&mut self) -> WLAN_EN_W<1> {
227        WLAN_EN_W::new(self)
228    }
229    #[doc = "Bit 2"]
230    #[inline(always)]
231    #[must_use]
232    pub fn ble_rx_ignore(&mut self) -> BLE_RX_IGNORE_W<2> {
233        BLE_RX_IGNORE_W::new(self)
234    }
235    #[doc = "Bit 3"]
236    #[inline(always)]
237    #[must_use]
238    pub fn m154_rx_ignore(&mut self) -> M154_RX_IGNORE_W<3> {
239        M154_RX_IGNORE_W::new(self)
240    }
241    #[doc = "Bits 4:7"]
242    #[inline(always)]
243    #[must_use]
244    pub fn bz_pri_thr(&mut self) -> BZ_PRI_THR_W<4> {
245        BZ_PRI_THR_W::new(self)
246    }
247    #[doc = "Bit 8"]
248    #[inline(always)]
249    #[must_use]
250    pub fn bz_pri_en(&mut self) -> BZ_PRI_EN_W<8> {
251        BZ_PRI_EN_W::new(self)
252    }
253    #[doc = "Bit 9"]
254    #[inline(always)]
255    #[must_use]
256    pub fn bz_pri_pol(&mut self) -> BZ_PRI_POL_W<9> {
257        BZ_PRI_POL_W::new(self)
258    }
259    #[doc = "Bit 10"]
260    #[inline(always)]
261    #[must_use]
262    pub fn bz_active_pol(&mut self) -> BZ_ACTIVE_POL_W<10> {
263        BZ_ACTIVE_POL_W::new(self)
264    }
265    #[doc = "Bit 11"]
266    #[inline(always)]
267    #[must_use]
268    pub fn bz_abort_pol(&mut self) -> BZ_ABORT_POL_W<11> {
269        BZ_ABORT_POL_W::new(self)
270    }
271    #[doc = "Bit 12"]
272    #[inline(always)]
273    #[must_use]
274    pub fn coex_pri(&mut self) -> COEX_PRI_W<12> {
275        COEX_PRI_W::new(self)
276    }
277    #[doc = "Bit 13"]
278    #[inline(always)]
279    #[must_use]
280    pub fn force_m154_win(&mut self) -> FORCE_M154_WIN_W<13> {
281        FORCE_M154_WIN_W::new(self)
282    }
283    #[doc = "Bit 14"]
284    #[inline(always)]
285    #[must_use]
286    pub fn force_ble_win(&mut self) -> FORCE_BLE_WIN_W<14> {
287        FORCE_BLE_WIN_W::new(self)
288    }
289    #[doc = "Bit 15"]
290    #[inline(always)]
291    #[must_use]
292    pub fn coex_option(&mut self) -> COEX_OPTION_W<15> {
293        COEX_OPTION_W::new(self)
294    }
295    #[doc = "Bits 16:22"]
296    #[inline(always)]
297    #[must_use]
298    pub fn coex_force_ch(&mut self) -> COEX_FORCE_CH_W<16> {
299        COEX_FORCE_CH_W::new(self)
300    }
301    #[doc = "Bit 24"]
302    #[inline(always)]
303    #[must_use]
304    pub fn m154_rx_abort_dis(&mut self) -> M154_RX_ABORT_DIS_W<24> {
305        M154_RX_ABORT_DIS_W::new(self)
306    }
307    #[doc = "Bit 25"]
308    #[inline(always)]
309    #[must_use]
310    pub fn m154_tx_abort_dis(&mut self) -> M154_TX_ABORT_DIS_W<25> {
311        M154_TX_ABORT_DIS_W::new(self)
312    }
313    #[doc = "Bit 26"]
314    #[inline(always)]
315    #[must_use]
316    pub fn ble_rx_abort_dis(&mut self) -> BLE_RX_ABORT_DIS_W<26> {
317        BLE_RX_ABORT_DIS_W::new(self)
318    }
319    #[doc = "Bit 27"]
320    #[inline(always)]
321    #[must_use]
322    pub fn ble_tx_abort_dis(&mut self) -> BLE_TX_ABORT_DIS_W<27> {
323        BLE_TX_ABORT_DIS_W::new(self)
324    }
325    #[doc = "Bits 28:31"]
326    #[inline(always)]
327    #[must_use]
328    pub fn coex_arb(&mut self) -> COEX_ARB_W<28> {
329        COEX_ARB_W::new(self)
330    }
331    #[doc = "Writes raw bits to the register."]
332    #[inline(always)]
333    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
334        self.0.bits(bits);
335        self
336    }
337}
338#[doc = "BZ_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 [bz_coex_ctrl](index.html) module"]
339pub struct BZ_COEX_CTRL_SPEC;
340impl crate::RegisterSpec for BZ_COEX_CTRL_SPEC {
341    type Ux = u32;
342}
343#[doc = "`read()` method returns [bz_coex_ctrl::R](R) reader structure"]
344impl crate::Readable for BZ_COEX_CTRL_SPEC {
345    type Reader = R;
346}
347#[doc = "`write(|w| ..)` method takes [bz_coex_ctrl::W](W) writer structure"]
348impl crate::Writable for BZ_COEX_CTRL_SPEC {
349    type Writer = W;
350    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
351    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
352}
353#[doc = "`reset()` method sets BZ_COEX_CTRL to value 0"]
354impl crate::Resettable for BZ_COEX_CTRL_SPEC {
355    const RESET_VALUE: Self::Ux = 0;
356}