cc2538_pac/rfcore_xreg/
freqctrl.rs1#[doc = "Register `FREQCTRL` reader"]
2pub type R = crate::R<FreqctrlSpec>;
3#[doc = "Register `FREQCTRL` writer"]
4pub type W = crate::W<FreqctrlSpec>;
5#[doc = "Field `FREQ` reader - Frequency control word The frequency word in FREQ\\[6:0\\]
6is an offset value from 2394 (fRF = FREQ\\[6 0\\]
7+ 2394). The RF-frequency is specified from 2405 to 2480 MHz in 1-MHz steps; hence, the only valid settings for FREQ\\[6:0\\]
8are 11 to 86 (11 + 2394 = 2405 and 86 + 2394 = 2480). The device supports the frequency range from 2394 to 2507 MHz. Consequently, the usable settings for FREQ\\[6:0\\]
9are 0 to 113. Settings outside of the usable range (114 to 127) give a frequency of 2507 MHz. IEEE 802.15.4-2006 specifies a frequency range from 2405 MHz to 2480 MHz with 16 channels 5 MHz apart. The channels are numbered 11 through 26. For an IEEE 802.15.4-2006 compliant system, the only valid settings are thus FREQ\\[6:0\\]
10= 11 + 5 (channel number - 11)."]
11pub type FreqR = crate::FieldReader;
12#[doc = "Field `FREQ` writer - Frequency control word The frequency word in FREQ\\[6:0\\]
13is an offset value from 2394 (fRF = FREQ\\[6 0\\]
14+ 2394). The RF-frequency is specified from 2405 to 2480 MHz in 1-MHz steps; hence, the only valid settings for FREQ\\[6:0\\]
15are 11 to 86 (11 + 2394 = 2405 and 86 + 2394 = 2480). The device supports the frequency range from 2394 to 2507 MHz. Consequently, the usable settings for FREQ\\[6:0\\]
16are 0 to 113. Settings outside of the usable range (114 to 127) give a frequency of 2507 MHz. IEEE 802.15.4-2006 specifies a frequency range from 2405 MHz to 2480 MHz with 16 channels 5 MHz apart. The channels are numbered 11 through 26. For an IEEE 802.15.4-2006 compliant system, the only valid settings are thus FREQ\\[6:0\\]
17= 11 + 5 (channel number - 11)."]
18pub type FreqW<'a, REG> = crate::FieldWriter<'a, REG, 7>;
19impl R {
20 #[doc = "Bits 0:6 - Frequency control word The frequency word in FREQ\\[6:0\\]
21is an offset value from 2394 (fRF = FREQ\\[6 0\\]
22+ 2394). The RF-frequency is specified from 2405 to 2480 MHz in 1-MHz steps; hence, the only valid settings for FREQ\\[6:0\\]
23are 11 to 86 (11 + 2394 = 2405 and 86 + 2394 = 2480). The device supports the frequency range from 2394 to 2507 MHz. Consequently, the usable settings for FREQ\\[6:0\\]
24are 0 to 113. Settings outside of the usable range (114 to 127) give a frequency of 2507 MHz. IEEE 802.15.4-2006 specifies a frequency range from 2405 MHz to 2480 MHz with 16 channels 5 MHz apart. The channels are numbered 11 through 26. For an IEEE 802.15.4-2006 compliant system, the only valid settings are thus FREQ\\[6:0\\]
25= 11 + 5 (channel number - 11)."]
26 #[inline(always)]
27 pub fn freq(&self) -> FreqR {
28 FreqR::new((self.bits & 0x7f) as u8)
29 }
30}
31impl W {
32 #[doc = "Bits 0:6 - Frequency control word The frequency word in FREQ\\[6:0\\]
33is an offset value from 2394 (fRF = FREQ\\[6 0\\]
34+ 2394). The RF-frequency is specified from 2405 to 2480 MHz in 1-MHz steps; hence, the only valid settings for FREQ\\[6:0\\]
35are 11 to 86 (11 + 2394 = 2405 and 86 + 2394 = 2480). The device supports the frequency range from 2394 to 2507 MHz. Consequently, the usable settings for FREQ\\[6:0\\]
36are 0 to 113. Settings outside of the usable range (114 to 127) give a frequency of 2507 MHz. IEEE 802.15.4-2006 specifies a frequency range from 2405 MHz to 2480 MHz with 16 channels 5 MHz apart. The channels are numbered 11 through 26. For an IEEE 802.15.4-2006 compliant system, the only valid settings are thus FREQ\\[6:0\\]
37= 11 + 5 (channel number - 11)."]
38 #[inline(always)]
39 pub fn freq(&mut self) -> FreqW<FreqctrlSpec> {
40 FreqW::new(self, 0)
41 }
42}
43#[doc = "Controls the RF frequency\n\nYou can [`read`](crate::Reg::read) this register and get [`freqctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`freqctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
44pub struct FreqctrlSpec;
45impl crate::RegisterSpec for FreqctrlSpec {
46 type Ux = u32;
47}
48#[doc = "`read()` method returns [`freqctrl::R`](R) reader structure"]
49impl crate::Readable for FreqctrlSpec {}
50#[doc = "`write(|w| ..)` method takes [`freqctrl::W`](W) writer structure"]
51impl crate::Writable for FreqctrlSpec {
52 type Safety = crate::Unsafe;
53 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
54 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
55}
56#[doc = "`reset()` method sets FREQCTRL to value 0"]
57impl crate::Resettable for FreqctrlSpec {
58 const RESET_VALUE: u32 = 0;
59}