Contiki-NG
dot-15-4g.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated - http://www.ti.com/
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 /*---------------------------------------------------------------------------*/
31 /**
32  * \addtogroup rf-core
33  * @{
34  *
35  * \defgroup rf-core-15-4g-modes IEEE 802.15.4g Frequency Bands and Modes
36  *
37  * @{
38  *
39  * \file
40  * Header file with descriptors for the various modes of operation defined in
41  * IEEE 802.15.4g
42  */
43 /*---------------------------------------------------------------------------*/
44 #ifndef DOT_15_4G_H_
45 #define DOT_15_4G_H_
46 /*---------------------------------------------------------------------------*/
47 #include "contiki.h"
48 
49 #include "driverlib/rf_mailbox.h"
50 /*---------------------------------------------------------------------------*/
51 /* IEEE 802.15.4g frequency band identifiers (Table 68f) */
52 #define DOT_15_4G_FREQUENCY_BAND_169 0 /* 169.400–169.475 (Europe) - 169 MHz band */
53 #define DOT_15_4G_FREQUENCY_BAND_450 1 /* 450–470 (US FCC Part 22/90) - 450 MHz band */
54 #define DOT_15_4G_FREQUENCY_BAND_470 2 /* 470–510 (China) - 470 MHz band */
55 #define DOT_15_4G_FREQUENCY_BAND_780 3 /* 779–787 (China) - 780 MHz band */
56 #define DOT_15_4G_FREQUENCY_BAND_863 4 /* 863–870 (Europe) - 863 MHz band */
57 #define DOT_15_4G_FREQUENCY_BAND_896 5 /* 896–901 (US FCC Part 90) - 896 MHz band */
58 #define DOT_15_4G_FREQUENCY_BAND_901 6 /* 901–902 (US FCC Part 24) - 901 MHz band */
59 #define DOT_15_4G_FREQUENCY_BAND_915 7 /* 902–928 (US) - 915 MHz band */
60 #define DOT_15_4G_FREQUENCY_BAND_917 8 /* 917–923.5 (Korea) - 917 MHz band */
61 #define DOT_15_4G_FREQUENCY_BAND_920 9 /* 920–928 (Japan) - 920 MHz band */
62 #define DOT_15_4G_FREQUENCY_BAND_928 10 /* 928–960 (US, non-contiguous) - 928 MHz band */
63 #define DOT_15_4G_FREQUENCY_BAND_950 11 /* 950–958 (Japan) - 950 MHz band */
64 #define DOT_15_4G_FREQUENCY_BAND_1427 12 /* 1427–1518 (US and Canada, non-contiguous) - 1427 MHz band */
65 #define DOT_15_4G_FREQUENCY_BAND_2450 13 /* 2400–2483.5 2450 MHz band */
66 #define DOT_15_4G_FREQUENCY_BAND_CUSTOM 14 /* For use with custom frequency band settings */
67 /*---------------------------------------------------------------------------*/
68 /* Default band selection to band 4 - 863MHz */
69 #ifdef DOT_15_4G_CONF_FREQUENCY_BAND_ID
70 #define DOT_15_4G_FREQUENCY_BAND_ID DOT_15_4G_CONF_FREQUENCY_BAND_ID
71 #else
72 #define DOT_15_4G_FREQUENCY_BAND_ID DOT_15_4G_FREQUENCY_BAND_863
73 #endif
74 /*---------------------------------------------------------------------------*/
75 /*
76  * Channel count, spacing and other params relating to the selected band. We
77  * currently only support some of the bands defined in .15.4g and for those
78  * bands we only support operating mode #1 (Table 134).
79  *
80  * DOT_15_4G_CHAN0_FREQUENCY is specified here in KHz
81  *
82  * Custom bands and configuration can be used with DOT_15_4G_FREQUENCY_BAND_CUSTOM.
83  *
84  * Example of custom setup for the 868Mhz sub-band in Europe with 11 channels,
85  * center frequency at 868.050MHz and channel spacing at 100KHz.
86  * These should be put in project-config.h or similar.
87  *
88  * #define DOT_15_4G_FREQUENCY_BAND_ID DOT_15_4G_FREQUENCY_BAND_CUSTOM
89  * #define DOT_15_4G_CHAN0_FREQUENCY 868050
90  * #define DOT_15_4G_CHANNEL_SPACING 100
91  * #define DOT_15_4G_CHANNEL_MAX 11
92  * #define PROP_MODE_CONF_LO_DIVIDER 0x05
93  */
94 #if DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_470
95 #define DOT_15_4G_CHANNEL_MAX 198
96 #define DOT_15_4G_CHANNEL_SPACING 200
97 #define DOT_15_4G_CHAN0_FREQUENCY 470200
98 #define PROP_MODE_CONF_LO_DIVIDER 0x0A
99 #define SMARTRF_SETTINGS_CONF_BAND_OVERRIDES HW32_ARRAY_OVERRIDE(0x405C,1), \
100  (uint32_t)0x18000280,
101 
102 #elif DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_780
103 #define DOT_15_4G_CHANNEL_MAX 38
104 #define DOT_15_4G_CHANNEL_SPACING 200
105 #define DOT_15_4G_CHAN0_FREQUENCY 779200
106 #define PROP_MODE_CONF_LO_DIVIDER 0x06
107 
108 #elif DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_863
109 #define DOT_15_4G_CHANNEL_MAX 33
110 #define DOT_15_4G_CHANNEL_SPACING 200
111 #define DOT_15_4G_CHAN0_FREQUENCY 863125
112 #define PROP_MODE_CONF_LO_DIVIDER 0x05
113 
114 #elif DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_915
115 #define DOT_15_4G_CHANNEL_MAX 128
116 #define DOT_15_4G_CHANNEL_SPACING 200
117 #define DOT_15_4G_CHAN0_FREQUENCY 902200
118 #define PROP_MODE_CONF_LO_DIVIDER 0x05
119 
120 #elif DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_920
121 #define DOT_15_4G_CHANNEL_MAX 37
122 #define DOT_15_4G_CHANNEL_SPACING 200
123 #define DOT_15_4G_CHAN0_FREQUENCY 920600
124 #define PROP_MODE_CONF_LO_DIVIDER 0x05
125 
126 #elif DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_950
127 #define DOT_15_4G_CHANNEL_MAX 32
128 #define DOT_15_4G_CHANNEL_SPACING 200
129 #define DOT_15_4G_CHAN0_FREQUENCY 951000
130 #define PROP_MODE_CONF_LO_DIVIDER 0x05
131 
132 #elif DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_CUSTOM
133 #ifndef DOT_15_4G_CHANNEL_MAX
134 #error DOT_15_4G_CHANNEL_MAX must be manually set when using custom frequency band
135 #endif
136 
137 #ifndef DOT_15_4G_CHANNEL_SPACING
138 #error DOT_15_4G_CHANNEL_SPACING must be manually set when using custom frequency band
139 #endif
140 
141 #ifndef DOT_15_4G_CHAN0_FREQUENCY
142 #error DOT_15_4G_CHAN0_FREQUENCY must be manually set when using custom frequency band
143 #endif
144 
145 #ifndef PROP_MODE_CONF_LO_DIVIDER
146 #error PROP_MODE_CONF_LO_DIVIDER must be manually set when using custom frequency band
147 #endif
148 #else
149 #error The selected frequency band is not supported
150 #endif
151 /*---------------------------------------------------------------------------*/
152 #endif /* DOT_15_4G_H_ */
153 /*---------------------------------------------------------------------------*/
154 /**
155  * @}
156  * @}
157  */