cpu_conf_cc26xx_cc13xx.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2016 Leon George
3  * SPDX-FileCopyrightText: 2020 Locha Inc
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
20 #include "kernel_defines.h"
21 
22 #include "cpu_conf_common.h"
23 
24 #include "cc26xx_cc13xx.h"
25 
26 #include "cc26xx_cc13xx_adi.h"
27 #include "cc26xx_cc13xx_ccfg.h"
28 #include "cc26xx_cc13xx_gpio.h"
29 #include "cc26xx_cc13xx_gpt.h"
30 #include "cc26xx_cc13xx_hard_api.h"
31 #include "cc26xx_cc13xx_i2c.h"
32 #include "cc26xx_cc13xx_ioc.h"
33 #include "cc26xx_cc13xx_rfc.h"
34 #include "cc26xx_cc13xx_uart.h"
35 #include "cc26xx_cc13xx_vims.h"
36 #include "cc26xx_cc13xx_wdt.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
46 #define CPU_DEFAULT_IRQ_PRIO (1U)
47 #define CPU_IRQ_NUMOF IRQN_COUNT
48 #define CPU_FLASH_BASE FLASH_BASE
59 #ifndef CONFIG_CC26XX_CC13XX_UPDATE_CCFG
60 #define CONFIG_CC26XX_CC13XX_UPDATE_CCFG 0
61 #endif
62 
69 #ifndef CONFIG_CC26XX_CC13XX_FORCE_VDDR_HH
70 #define CONFIG_CC26XX_CC13XX_FORCE_VDDR_HH 0
71 #endif
72 
81 #ifndef CONFIG_CC26XX_CC13XX_GPRAM
82 #define CONFIG_CC26XX_CC13XX_GPRAM 0
83 #endif
84 
89 #if IS_ACTIVE(CONFIG_CC26XX_CC13XX_BL_LEVEL_ACTIVE_HIGH)
90 #define CONFIG_CC26XX_CC13XX_BL_LEVEL 0x1
91 #elif IS_ACTIVE(CONFIG_CC26XX_CC13XX_BL_LEVEL_ACTIVE_LOW)
92 #define CONFIG_CC26XX_CC13XX_BL_LEVEL 0x0
93 #endif
94 
95 #ifndef CONFIG_CC26XX_CC13XX_BL_LEVEL
96 #define CONFIG_CC26XX_CC13XX_BL_LEVEL 0x1
97 #endif
98 
103 #ifndef CONFIG_CC26XX_CC13XX_BL_PIN
104 #define CONFIG_CC26XX_CC13XX_BL_PIN 0xFF
105 #endif
106 
107 /* high VDDR is available only on CC13xx CPUs */
108 #if IS_ACTIVE(CONFIG_CPU_FAM_CC13XX)
109 
110 #if IS_ACTIVE(CONFIG_CC26XX_CC13XX_FORCE_VDDR_HH)
111 #define SET_MODE_CONF_1_ALT_DCDC_VMIN 0xC
112 #define SET_MODE_CONF_VDDR_EXT_LOAD 0x1
113 #endif
114 
115 #endif /* IS_ACTIVE(CONFIG_CPU_FAM_CC13XX) */
116 
117 #if !IS_ACTIVE(CONFIG_CC26XX_CC13XX_GPRAM)
118 #define SET_SIZE_AND_DIS_FLAGS_DIS_GPRAM 0x1
119 #endif
120 
121 #if IS_ACTIVE(CONFIG_CC26XX_CC13XX_ROM_BOOTLOADER)
122 #define SET_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
123 #define SET_BL_CONFIG_BL_ENABLE 0xC5
125 #if defined(CONFIG_CC26XX_CC13XX_BL_LEVEL)
126 #define SET_BL_CONFIG_BL_LEVEL CONFIG_CC26XX_CC13XX_BL_LEVEL
127 #endif
128 
129 #if IS_ACTIVE(CONFIG_CC26XX_CC13XX_BL_PIN_EN)
130 #define SET_BL_CONFIG_BL_PIN_NUMBER CONFIG_CC26XX_CC13XX_BL_PIN
131 #endif
132 
133 #endif /* IS_USED(CONFIG_CC26XX_CC13XX_ROM_BOOTLOADER) */
134 
135 /* when GPRAM is not disabled, use it as a backup RAM */
136 #if IS_ACTIVE(CONFIG_CC26XX_CC13XX_DIS_GPRAM)
137 #define NUM_HEAPS (1)
138 #else
139 #define NUM_HEAPS (2)
140 #endif
151 #ifndef SET_EXT_LF_CLK_DIO
152 #define SET_EXT_LF_CLK_DIO 0x01
153 #endif
154 
167 #ifndef SET_EXT_LF_CLK_RTC_INCREMENT
168 #define SET_EXT_LF_CLK_RTC_INCREMENT 0x800000
169 #endif
170 
171 #if defined(CPU_VARIANT_X2) || defined(DOXYGEN)
182 #ifndef SET_MODE_CONF_1_TCXO_TYPE
183 #define SET_MODE_CONF_1_TCXO_TYPE 0x01
184 #endif
185 
193 #ifndef SET_MODE_CONF_1_TCXO_MAX_START
194 #define SET_MODE_CONF_1_TCXO_MAX_START 0x7F
195 #endif
196 
197 #endif /* defined(CPU_VARIANT_X2) || defined(DOXYGEN) */
198 
217 #ifndef SET_MODE_CONF_1_ALT_DCDC_VMIN
218 #define SET_MODE_CONF_1_ALT_DCDC_VMIN 0x8
219 #endif
220 
226 #ifndef SET_MODE_CONF_1_ALT_DCDC_DITHER_EN
227 #define SET_MODE_CONF_1_ALT_DCDC_DITHER_EN 0x0
228 #endif
229 
237 #ifndef SET_MODE_CONF_1_ALT_DCDC_IPEAK
238 #define SET_MODE_CONF_1_ALT_DCDC_IPEAK 0x0
239 #endif
240 
244 #ifndef SET_MODE_CONF_1_DELTA_IBIAS_INIT
245 #define SET_MODE_CONF_1_DELTA_IBIAS_INIT 0x0
246 #endif
247 
251 #ifndef SET_MODE_CONF_1_DELTA_IBIAS_OFFSET
252 #define SET_MODE_CONF_1_DELTA_IBIAS_OFFSET 0x0
253 #endif
254 
258 #ifndef SET_MODE_CONF_1_XOSC_MAX_START
259 #define SET_MODE_CONF_1_XOSC_MAX_START 0x10
260 #endif
261 
265 #ifndef SET_SIZE_AND_DIS_FLAGS_SIZE_OF_CCFG
266 #define SET_SIZE_AND_DIS_FLAGS_SIZE_OF_CCFG 0x0058
267 #endif
268 
272 #ifndef SET_SIZE_AND_DIS_FLAGS_DISABLE_FLAGS
273 #define SET_SIZE_AND_DIS_FLAGS_DISABLE_FLAGS \
274  (CCFG_SIZE_AND_DIS_FLAGS_DISABLE_FLAGS_m >> \
275  CCFG_SIZE_AND_DIS_FLAGS_DISABLE_FLAGS_s)
276 #endif
277 
283 #ifndef SET_SIZE_AND_DIS_FLAGS_DIS_TCXO
284 #define SET_SIZE_AND_DIS_FLAGS_DIS_TCXO 0x1
285 #endif
286 
295 #ifndef SET_SIZE_AND_DIS_FLAGS_DIS_GPRAM
296 #define SET_SIZE_AND_DIS_FLAGS_DIS_GPRAM 0x0
297 #endif
298 
308 #ifndef SET_SIZE_AND_DIS_FLAGS_DIS_ALT_DCDC_SETTING
309 #define SET_SIZE_AND_DIS_FLAGS_DIS_ALT_DCDC_SETTING 0x0
310 #endif
311 
321 #ifndef SET_SIZE_AND_DIS_FLAGS_DIS_XOSC_OVR
322 #define SET_SIZE_AND_DIS_FLAGS_DIS_XOSC_OVR 0x1
323 #endif
324 
335 #ifndef SET_MODE_CONF_VDDR_TRIM_SLEEP_DELTA
336 #define SET_MODE_CONF_VDDR_TRIM_SLEEP_DELTA 0xF
337 #endif
338 
344 #ifndef SET_MODE_CONF_DCDC_RECHARGE
345 #define SET_MODE_CONF_DCDC_RECHARGE 0x0
346 #endif
347 
353 #ifndef SET_MODE_CONF_DCDC_ACTIVE
354 #define SET_MODE_CONF_DCDC_ACTIVE 0x0
355 #endif
356 
361 #ifndef SET_MODE_CONF_VDDR_EXT_LOAD
362 #define SET_MODE_CONF_VDDR_EXT_LOAD 0x0
363 #endif
364 
372 #ifndef SET_MODE_CONF_VDDS_BOD_LEVEL
373 #define SET_MODE_CONF_VDDS_BOD_LEVEL 0x1
374 #endif
375 
384 #ifndef SET_MODE_CONF_SCLK_LF_OPTION
385 #define SET_MODE_CONF_SCLK_LF_OPTION 0x2
386 #endif
387 
402 #ifndef SET_MODE_CONF_VDDR_TRIM_SLEEP_TC
403 #define SET_MODE_CONF_VDDR_TRIM_SLEEP_TC 0x1
404 #endif
405 
409 #ifndef SET_MODE_CONF_RTC_COMP
410 #define SET_MODE_CONF_RTC_COMP 0x1
411 #endif
412 
421 #ifndef SET_MODE_CONF_XOSC_FREQ
422 #define SET_MODE_CONF_XOSC_FREQ 0x2
423 #endif
424 
431 #ifndef SET_MODE_CONF_XOSC_CAP_MOD
432 #define SET_MODE_CONF_XOSC_CAP_MOD 0x1
433 #endif
434 
438 #ifndef SET_MODE_CONF_HF_COMP
439 #define SET_MODE_CONF_HF_COMP 0x1
440 #endif
441 
447 #ifndef SET_MODE_CONF_XOSC_CAPARRAY_DELTA
448 #define SET_MODE_CONF_XOSC_CAPARRAY_DELTA 0xFF
449 #endif
450 
459 #ifndef SET_MODE_CONF_VDDR_CAP
460 #define SET_MODE_CONF_VDDR_CAP 0x3A
461 #endif
462 
470 #ifndef SET_BL_CONFIG_BOOTLOADER_ENABLE
471 #define SET_BL_CONFIG_BOOTLOADER_ENABLE 0x00
472 #endif
473 
480 #ifndef SET_BL_CONFIG_BL_LEVEL
481 #define SET_BL_CONFIG_BL_LEVEL 0x1
482 #endif
483 
488 #ifndef SET_BL_CONFIG_BL_PIN_NUMBER
489 #define SET_BL_CONFIG_BL_PIN_NUMBER 0xFF
490 #endif
491 
497 #ifndef SET_BL_CONFIG_BL_ENABLE
498 #define SET_BL_CONFIG_BL_ENABLE 0xFF
499 #endif
500 
506 #ifndef SET_CCFG_TAP_DAP_0_CPU_DAP_ENABLE
507 #define SET_CCFG_TAP_DAP_0_CPU_DAP_ENABLE 0xC5
508 #endif
509 
515 #ifndef SET_CCFG_TAP_DAP_0_PWRPROF_TAP_ENABLE
516 #define SET_CCFG_TAP_DAP_0_PWRPROF_TAP_ENABLE 0xC5
517 #endif
518 
524 #ifndef SET_CCFG_TAP_DAP_0_TEST_TAP_ENABLE
525 #define SET_CCFG_TAP_DAP_0_TEST_TAP_ENABLE 0x00
526 #endif
529 #ifdef __cplusplus
530 }
531 #endif
532 
CC26xx, CC13xx definitions.
CC26xx/CC13xx MCU I/O register definitions.
CC26xx/CC13xx CCFG register definitions.
Driver for the cc26xx/cc13xx GPIO controller.
definitions for the CC26xx/CC13XX GPT modules
CC26xx/CC13xx ROM Hard-API.
CC26xx/CC13xx MCU I/O register definitions.
CC26xx/CC13xx MCU I/O register definitions.
CC26xx/CC13xx MCU I/O register definitions.
CC26xx/CC13xx UART interface.
CC26xx/CC13xx VIMS register definitions.
CC26xx/CC13xx WDT register definitions.
Common macros and compiler attributes/pragmas configuration.