Contiki 3.x
ADF7023_Config.h
1 /*
2  * Copyright (c) 2014, Analog Devices, Inc.
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  *
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29  * OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 /**
32  * \author Dragos Bogdan <Dragos.Bogdan@Analog.com>
33  * Contributors: Ian Martin <martini@redwirellc.com>
34  */
35 
36 #ifndef __ADF7023_CONFIG_H__
37 #define __ADF7023_CONFIG_H__
38 
39 /******************************************************************************/
40 /***************************** Include Files **********************************/
41 /******************************************************************************/
42 
43 #include <stdint.h>
44 
45 #include "ADF7023.h"
46 
47 #define LENGTH_OFFSET 4
48 #define PACKET_LENGTH_MAX 240
49 #define ADDRESS_MATCH_OFFSET 0
50 #define ADDRESS_LENGTH 0
51 
52 #define F_PFD 26 /* MHz */
53 
54 #ifndef CHANNEL_FREQ_MHZ
55 /* #define CHANNEL_FREQ_MHZ 433 // Wrong antenna (432993072 Hz) */
56 /* #define CHANNEL_FREQ_MHZ 868 // Europe */
57 #define CHANNEL_FREQ_MHZ 915 /* ISM band center frequency for the Americas, Greenland and some of the eastern Pacific Islands. */
58 #endif
59 
60 #define CHANNEL_FREQ (((uint32_t)CHANNEL_FREQ_MHZ << 16) / F_PFD)
61 
62 /******************************************************************************/
63 /************************* Variables Declarations *****************************/
64 /******************************************************************************/
65 struct ADF7023_BBRAM ADF7023_BBRAMDefault =
66 {
67  /* interruptMask0 - 0x100 */
68  BBRAM_INTERRUPT_MASK_0_INTERRUPT_TX_EOF |
69  BBRAM_INTERRUPT_MASK_0_INTERRUPT_CRC_CORRECT,
70  /* interruptMask1 - 0x101 */
71  0x00,
72  /* numberOfWakeups0 - 0x102 */
73  0x00,
74  /* numberOfWakeups1 - 0x103 */
75  0x00,
76  /* numberOfWakeupsIrqThreshold0 - 0x104 */
77  0xFF,
78  /* numberOfWakeupsIrqThreshold1 - 0x105 */
79  0xFF,
80  /* rxDwellTime - 0x106 */
81  0x00,
82  /* parmtimeDivider - 0x107 */
83  0x33,
84  /* swmRssiThresh - 0x108 */
85  0x31,
86  /* channelFreq0 - 0x109 */
87  (CHANNEL_FREQ >> 0) & 0xff,
88  /* channelFreq1 - 0x10A */
89  (CHANNEL_FREQ >> 8) & 0xff,
90  /* channelFreq2 - 0x10B */
91  (CHANNEL_FREQ >> 16) & 0xff,
92  /* radioCfg0 - 0x10C */
93  BBRAM_RADIO_CFG_0_DATA_RATE_7_0(0xE8), /* Data rate: 100 kbps */
94  /* radioCfg1 - 0x10D */
95  BBRAM_RADIO_CFG_1_FREQ_DEVIATION_11_8(0x00) | /* Frequency deviation: 25 Hz */
96  BBRAM_RADIO_CFG_1_DATA_RATE_11_8(0x03), /* Data rate: 100 kbps */
97  /* radioCfg2 - 0x10E */
98  BBRAM_RADIO_CFG_2_FREQ_DEVIATION_7_0(0xFA), /* Frequency deviation: 25 Hz */
99  /* radioCfg3 - 0x10F */
100  0x31,
101  /* radioCfg4 - 0x110 */
102  0x16,
103  /* radioCfg5 - 0x111 */
104  0x00,
105  /* radioCfg6 - 0x112 */
106  BBRAM_RADIO_CFG_6_DISCRIM_PHASE(0x2),
107  /* radioCfg7 - 0x113 */
108  BBRAM_RADIO_CFG_7_AGC_LOCK_MODE(3),
109  /* radioCfg8 - 0x114 */
110  BBRAM_RADIO_CFG_8_PA_SINGLE_DIFF_SEL |
111  BBRAM_RADIO_CFG_8_PA_LEVEL(0xF) |
112  BBRAM_RADIO_CFG_8_PA_RAMP(1),
113  /* radioCfg9 - 0x115 */
114  BBRAM_RADIO_CFG_9_IFBW(2),
115  /* radioCfg10 - 0x116 */
116  BBRAM_RADIO_CFG_10_AFC_SCHEME(2) |
117  BBRAM_RADIO_CFG_10_AFC_LOCK_MODE(3),
118  /* radioCfg11 - 0x117 */
119  BBRAM_RADIO_CFG_11_AFC_KP(3) |
120  BBRAM_RADIO_CFG_11_AFC_KI(7),
121  /* imageRejectCalPhase - 0x118 */
122  0x00,
123  /* imageRejectCalAmplitude - 0x119 */
124  0x00,
125  /* modeControl - 0x11A */
126  BBRAM_MODE_CONTROL_BB_CAL,
127  /* preambleMatch - 0x11B */
128  0x0C,
129  /* symbolMode - 0x11C */
130  BBRAM_SYMBOL_MODE_MANCHESTER_ENC,
131  /* preambleLen - 0x11D */
132  0x20,
133  /* crcPoly0 - 0x11E */
134  0x00,
135  /* crcPoly1 - 0x11F */
136  0x00,
137  /* syncControl - 0x120 */
138  BBRAM_SYNC_CONTROL_SYNC_WORD_LENGTH(8),
139  /* syncByte0 - 0x121 */
140  0x00,
141  /* syncByte1 - 0x122 */
142  0x00,
143  /* syncByte2 - 0x123 */
144  0x12,
145  /* txBaseAdr - 0x124 */
146  ADF7023_TX_BASE_ADR,
147  /* rxBaseAdr - 0x125 */
148  ADF7023_RX_BASE_ADR,
149  /* 0x126 (PACKET_LENGTH_CONTROL) = */ 0x20 | LENGTH_OFFSET,
150  /* 0x127 (PACKET_LENGTH_MAX) = */ PACKET_LENGTH_MAX,
151  /* staticRegFix - 0x128 */
152  0x00,
153  /* 0x129 (ADDRESS_MATCH_OFFSET) = */ ADDRESS_MATCH_OFFSET,
154  /* 0x12a (ADDRESS_LENGTH) = */ ADDRESS_LENGTH,
155  /* addressFiltering0 - 0x12B */
156  0x01,
157  /* addressFiltering1 - 0x12C */
158  0xFF,
159  /* addressFiltering2 - 0x12D */
160  0xFF,
161  /* addressFiltering3 - 0x12E */
162  0xFF,
163  /* addressFiltering4 - 0x12F */
164  0x02,
165  /* addressFiltering5 - 0x130 */
166  0x0F,
167  /* addressFiltering6 - 0x131 */
168  0xFF,
169  /* addressFiltering7 - 0x132 */
170  0x0F,
171  /* addressFiltering8 - 0x133 */
172  0xFF,
173  /* addressFiltering9 - 0x134 */
174  0x00,
175  /* addressFiltering10 - 0x135 */
176  0x00,
177  /* addressFiltering11 - 0x136 */
178  0x00,
179  /* addressFiltering12 - 0x137 */
180  0x00,
181  /* rssiWaitTime - 0x138 */
182  0x00,
183  /* testmodes - 0x139 */
184  0x00,
185  /* transitionClockDiv - 0x13A */
186  0x00,
187  /* reserved0 - 0x13B */
188  0x00,
189  /* reserved1 - 0x13C */
190  0x00,
191  /* reserved2 - 0x13D */
192  0x00,
193  /* rxSynthLockTime - 0x13E */
194  0x00,
195  /* txSynthLockTime - 0x13F */
196  0x00,
197 };
198 
199 #endif /* __ADF7023_CONFIG_H__ */