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