1 /* 2 * Copyright (c) 2017 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_DRIVERS_IEEE802154_IEEE802154_CC1200_RF_H_ 8 #define ZEPHYR_DRIVERS_IEEE802154_IEEE802154_CC1200_RF_H_ 9 10 #include <drivers/ieee802154/cc1200.h> 11 12 #define CC1200_RF_NON_EXT_SPACE_REGS 42 13 #define CC1200_RF_EXT_SPACE_REGS 58 14 15 /* About PKTCFGn from Kconfig: 16 * CONFIG_IEEE802154_CC1200_PKTCFG0 LENGTH_VAR_1 17 * CONFIG_IEEE802154_CC1200_PKTCFG1 (APPEND_STATUS | CRC_FFFF | ADDR_NO_CHK) 18 * We do not enable 802.15.4g mode yet: 19 * CONFIG_IEEE802154_CC1200_PKTCFG2 (PKT_FORMAT_NORMAL_MODE | CCA_ALWAYS_CLEAR) 20 **/ 21 22 #ifdef CONFIG_IEEE802154_CC1200_RF_PRESET 23 24 #if defined(CONFIG_IEEE802154_CC1200_RF_SET_0) 25 26 const struct cc1200_rf_registers_set cc1200_rf_settings = { 27 .chan_center_freq0 = 863125, 28 .channel_limit = 33, 29 .channel_spacing = 2000, /* 200 KHz */ 30 .registers = { 31 0x6F, /* SYNC3 */ 32 0x4E, 33 0x90, 34 0x4E, 35 0xE5, 36 0x23, 37 0x47, 38 0x0B, 39 0x56, 40 0x19, /* 0x14 */ 41 0xBA, 42 0xC8, 43 0x84, 44 0x42, 45 0x05, 46 0x94, 47 0x7A, 48 0xE1, 49 0x27, 50 CONFIG_IEEE802154_CC1200_CCA_THRESHOLD, 51 CONFIG_IEEE802154_CC1200_RSSI_OFFSET, 52 0xB1, 53 0x20, 54 0x11, 55 0x90, 56 0x00, 57 0x00, 58 CONFIG_IEEE802154_CC1200_SETTLING_CFG, 59 0x12, 60 0x08, 61 0x21, 62 0x00, 63 0x00, 64 0x00, 65 CONFIG_IEEE802154_CC1200_PKTCFG2, 66 CONFIG_IEEE802154_CC1200_PKTCFG1, 67 CONFIG_IEEE802154_CC1200_PKTCFG0, 68 CONFIG_IEEE802154_CC1200_RFEND_CFG1, 69 CONFIG_IEEE802154_CC1200_RFEND_CFG0, 70 0x7F, 71 0x56, 72 0x0F, /* ASK_CFG */ 73 0x18, /* IF_MIX_CFG */ 74 0x20, 75 0x03, 76 0x00, 77 0x00, 78 0x02, 79 0x01, 80 0x00, 81 0x00, 82 0x00, 83 0x00, 84 0x00, 85 0x56, 86 0xCC, 87 0xCC, 88 0x02, 89 0xEE, 90 0x10, 91 0x04, 92 0x50, 93 0x00, 94 0x20, 95 0x40, 96 0x0E, 97 0x28, 98 0x03, 99 0x00, 100 0x33, 101 0xF7, 102 0x0F, 103 0x00, 104 0x00, 105 0x6E, 106 0x1C, 107 0xAC, 108 0x14, 109 0x00, 110 0x00, 111 0x00, 112 0xB5, 113 0x00, 114 0x02, 115 0x00, 116 0x00, 117 0x10, 118 0x00, 119 0x00, 120 0x05, 121 0x01, 122 0x01, 123 0x0E, 124 0xA0, 125 0x03, 126 0x04, 127 0x03, 128 0x00, 129 0x00, 130 0x00, /* PA_CFG3 */ 131 } 132 }; 133 134 #elif defined(CONFIG_IEEE802154_CC1200_RF_SET_1) 135 136 const struct cc1200_rf_registers_set cc1200_rf_settings = { 137 .chan_center_freq0 = 920600, 138 .channel_limit = 38, 139 .channel_spacing = 2000, /* 200 KHz */ 140 .registers = { 141 0x6F, /* SYNC3 */ 142 0x4E, 143 0x90, 144 0x4E, 145 0xE5, 146 0x23, 147 0x47, 148 0x0B, 149 0x56, 150 0x14, 151 0xBA, 152 0xC8, 153 0x84, 154 0x42, 155 0x05, 156 0x94, 157 0x7A, 158 0xE1, 159 0x27, 160 CONFIG_IEEE802154_CC1200_CCA_THRESHOLD, 161 CONFIG_IEEE802154_CC1200_RSSI_OFFSET, 162 0xB1, 163 0x20, 164 0x11, 165 0x90, 166 0x00, 167 0x00, 168 CONFIG_IEEE802154_CC1200_SETTLING_CFG, 169 0x12, 170 0x08, 171 0x21, 172 0x00, 173 0x00, 174 0x00, 175 CONFIG_IEEE802154_CC1200_PKTCFG2, 176 CONFIG_IEEE802154_CC1200_PKTCFG1, 177 CONFIG_IEEE802154_CC1200_PKTCFG0, 178 CONFIG_IEEE802154_CC1200_RFEND_CFG1, 179 CONFIG_IEEE802154_CC1200_RFEND_CFG0 180 0x7F, 181 0x56, 182 0x0F, /* ASK_CFG */ 183 0x18, /* IF_MIX_CFG */ 184 0x20, 185 0x03, 186 0x00, 187 0x00, 188 0x02, 189 0x01, 190 0x00, 191 0x00, 192 0x00, 193 0x00, 194 0x00, 195 0x5C, 196 0x0F, 197 0x5C, 198 0x02, 199 0xEE, 200 0x10, 201 0x04, 202 0x55, 203 0x00, 204 0x20, 205 0x40, 206 0x0E, 207 0x28, 208 0x03, 209 0x00, 210 0x33, 211 0xFF, 212 0x17, 213 0x00, 214 0x00, 215 0x6E, 216 0x1C, 217 0xAC, 218 0x14, 219 0x00, 220 0x00, 221 0x00, 222 0xB5, 223 0x00, 224 0x02, 225 0x00, 226 0x00, 227 0x10, 228 0x00, 229 0x00, 230 0x05, 231 0x01, 232 0x01, 233 0x0E, 234 0xA0, 235 0x03, 236 0x04, 237 0x03, 238 0x00, 239 0x00, 240 0x00, /* PA_CFG3 */ 241 } 242 }; 243 244 #elif defined(CONFIG_IEEE802154_CC1200_RF_SET_2) 245 246 const struct cc1200_rf_registers_set cc1200_rf_settings = { 247 .chan_center_freq0 = 433164, 248 .channel_limit = 14, 249 .channel_spacing = 2000, /* 200 KHz */ 250 .registers = { 251 0x6F, /* SYNC3 */ 252 0x4E, 253 0x90, 254 0x4E, 255 0xE5, 256 0x23, 257 0x47, 258 0x0B, 259 0x56, 260 0x14, 261 0xBA, 262 0xC8, 263 0x84, 264 0x42, 265 0x05, 266 0x94, 267 0x7A, 268 0xE1, 269 0x27, 270 CONFIG_IEEE802154_CC1200_CCA_THRESHOLD, 271 CONFIG_IEEE802154_CC1200_RSSI_OFFSET, 272 0xB1, 273 0x20, 274 0x11, 275 0x90, 276 0x00, 277 0x00, 278 CONFIG_IEEE802154_CC1200_SETTLING_CFG, 279 0x14, 280 0x08, 281 0x21, 282 0x00, 283 0x00, 284 0x00, 285 CONFIG_IEEE802154_CC1200_PKTCFG2, 286 CONFIG_IEEE802154_CC1200_PKTCFG1, 287 CONFIG_IEEE802154_CC1200_PKTCFG0, 288 CONFIG_IEEE802154_CC1200_RFEND_CFG1, 289 CONFIG_IEEE802154_CC1200_RFEND_CFG0, 290 0x7F, 291 0x56, 292 0x0F, /* ASK_CFG */ 293 0x18, /* IF_MIX_CFG */ 294 0x20, 295 0x03, 296 0x00, 297 0x00, 298 0x02, 299 0x01, 300 0x00, 301 0x00, 302 0x00, 303 0x00, 304 0x00, 305 0x56, 306 0xCC, 307 0xCC, 308 0x02, 309 0xEE, 310 0x10, 311 0x04, 312 0x50, 313 0x00, 314 0x20, 315 0x40, 316 0x0E, 317 0x28, 318 0x03, 319 0x00, 320 0x33, 321 0xF7, 322 0x0F, 323 0x00, 324 0x00, 325 0x6E, 326 0x1C, 327 0xAC, 328 0x14, 329 0x00, 330 0x00, 331 0x00, 332 0xB5, 333 0x00, 334 0x02, 335 0x00, 336 0x00, 337 0x10, 338 0x00, 339 0x00, 340 0x05, 341 0x01, 342 0x01, 343 0x0E, 344 0xA0, 345 0x03, 346 0x04, 347 0x03, 348 0x00, 349 0x00, 350 0x00, /* PA_CFG3 */ 351 } 352 }; 353 354 #endif /* CONFIG_IEEE802154_CC1200_RF_SET_n */ 355 356 #endif /* CONFIG_IEEE802154_CC1200_RF_PRESET */ 357 358 #endif /* ZEPHYR_DRIVERS_IEEE802154_IEEE802154_CC1200_RF_H_ */ 359