SmartSnippets DA1459x SDK
bsp_defaults.h
Go to the documentation of this file.
1 
54 #ifndef BSP_DEFAULTS_H_
55 #define BSP_DEFAULTS_H_
56 
57 /* ---------------------------------------------------------------------------------------------- */
58 
59 
60 /* ----------------------------------- Deprecated Configuration --------------------------------- */
61 
62 /* Deprecated configuration options must not be defined by the application. */
63 
64 #define DG_CONFIG_DEPRECATED_MSG " must not be defined by the application. This option is NO LONGER SUPPORTED"
65 #define DG_CONFIG_NOT_APPLICABLE_MSG " must not be defined by the application. It is NOT APPLICABLE"
66 
67 #ifdef dg_configPOWER_CONFIG
68 #error "dg_configPOWER_CONFIG must not be defined by the application. This option is NO LONGER SUPPORTED."\
69  " There's a single power configuration setup."
70 #endif
71 
72 #ifdef dg_configFORCE_DEEP_SLEEP
73 #error "dg_configFORCE_DEEP_SLEEP must not be defined by the application. This option is NO LONGER SUPPORTED."\
74  " Forcing the system to enter into clockless sleep during deep sleep is no longer supported."
75 #endif
76 
77 #ifdef dg_configMEM_RETENTION_MODE_PRESERVE_IMAGE
78 #error "dg_configMEM_RETENTION_MODE_PRESERVE_IMAGE must not be defined by the application. This option is NO LONGER SUPPORTED."
79 #endif
80 
81 #ifdef dg_configUSE_ADC
82 #error "dg_configUSE_ADC must not be defined by the application. This option is NO LONGER SUPPORTED."\
83  " Specify the ADC block you wish to configure (i.e. dg_configUSE_HW_GPADC)."
84 #endif
85 
86 #ifdef dg_configCONFIG_HEADER_IN_FLASH
87 #error "dg_configCONFIG_HEADER_IN_FLASH must not be defined by the application. This option is NO LONGER SUPPORTED."\
88  " The values of the trim registers are not anymore taken from the Flash."
89 #endif
90 
91 #ifdef dg_configPOWER_EXT_1V8_PERIPHERALS
92 #error "dg_configPOWER_EXT_1V8_PERIPHERALS must not be defined by the application. This option is NO LONGER SUPPORTED."\
93  " Use dg_configPOWER_1V8P instead!"
94 #endif
95 
96 #ifdef dg_configUSE_HW_TEMPSENS
97 #error "dg_configUSE_HW_TEMPSENS must not be defined by the application. This option is NO LONGER SUPPORTED."\
98  " Use dg_configUSE_HW_GPADC and HW_GPADC_INPUT_SE_TEMPSENS instead!"
99 #endif
100 
101 #ifdef dg_configINITIAL_SLEEP_DELAY_TIME
102 #pragma message "dg_configINITIAL_SLEEP_DELAY_TIME" DG_CONFIG_DEPRECATED_MSG ". At startup, the system will stay "\
103  "active for at least dg_configXTAL32K_SETTLE_TIME before it is allowed to go to sleep."
104 #endif
105 
106 #ifdef dg_configPOWER_FLASH
107 # pragma message "dg_configPOWER_FLASH" DG_CONFIG_DEPRECATED_MSG
108 # undef dg_configPOWER_FLASH
109 #endif
110 
111 /* ----------------------------------- OS Configuration ----------------------------------------- */
112 
118 #ifndef OS_BAREMETAL
119 #define OS_PRESENT
120 #else
121 #undef OS_PRESENT
122 #endif /* OS options */
123 
124 /* --------------------------------- Clock settings -------------------------------------------- */
125 
142 #ifndef dg_configUSE_LP_CLK
143 #define dg_configUSE_LP_CLK LP_CLK_RCX
144 #endif /* dg_configUSE_LP_CLK */
145 
151 #ifndef dg_configLP_CLK_SOURCE
152 #define dg_configLP_CLK_SOURCE LP_CLK_IS_ANALOG
153 #endif
154 
155 #if (dg_configUSE_LP_CLK == LP_CLK_ANY)
156 #error "LP_CLK_ANY is not currently supported!"
157 #endif
158 
159 #if ((dg_configLP_CLK_SOURCE == LP_CLK_IS_DIGITAL) && (dg_configUSE_LP_CLK == LP_CLK_RCX))
160 #error "When the LP source is digital (External), the option LP_CLK_RCX is invalid!"
161 #endif
162 
173 #ifndef dg_configEXT_LP_IS_DIGITAL
174 #define dg_configEXT_LP_IS_DIGITAL (0)
175 #endif
176 
186 #ifndef dg_configMIN_SLEEP_TIME
187 # if ((dg_configUSE_LP_CLK == LP_CLK_32000) || (dg_configUSE_LP_CLK == LP_CLK_32768))
188 # define dg_configMIN_SLEEP_TIME (33*3) // 3 msec
189 # elif (dg_configUSE_LP_CLK == LP_CLK_RCX)
190 # define dg_configMIN_SLEEP_TIME cm_rcx_us_2_lpcycles_low_acc(3000) // 3 msec
191 # else /* LP_CLK_ANY */
192  /* Must be defined in the custom_config_<>.h file. It should be ~3msec but this may vary. */
193 # endif
194 #endif
195 
200 /* ----------------------------------- Image Configuration -------------------------------------- */
201 
218 #ifndef dg_configIMAGE_SETUP
219 #define dg_configIMAGE_SETUP DEVELOPMENT_MODE
220 #endif
221 
232 #ifndef dg_configSKIP_MAGIC_CHECK_AT_START
233 #define dg_configSKIP_MAGIC_CHECK_AT_START (0)
234 #endif
235 
241 #ifndef dg_configEMULATE_QSPI_COPY
242 #define dg_configEMULATE_QSPI_COPY (0)
243 #endif
244 
254 #ifndef dg_configEXEC_MODE
255 #define dg_configEXEC_MODE MODE_IS_RAM
256 #endif
257 
268 #ifndef dg_configCODE_LOCATION
269 #define dg_configCODE_LOCATION NON_VOLATILE_IS_NONE
270 #endif
271 
276 /* ----------------------------------- System Configuration ------------------------------------- */
277 
296 #if (dg_configEXEC_MODE != MODE_IS_MIRRORED)
297 # undef dg_configIMAGE_COPY_TIME
298 # define dg_configIMAGE_COPY_TIME (0)
299 #elif !defined(dg_configIMAGE_COPY_TIME)
300 # if ((dg_configUSE_LP_CLK == LP_CLK_32000) || (dg_configUSE_LP_CLK == LP_CLK_32768))
301 # define dg_configIMAGE_COPY_TIME (64)
302 # elif (dg_configUSE_LP_CLK == LP_CLK_RCX)
303 # define dg_configIMAGE_COPY_TIME cm_rcx_us_2_lpcycles(1950)
304 # endif
305 #endif
306 
315 #ifndef dg_configUSE_WDOG
316 #define dg_configUSE_WDOG (0)
317 #endif
318 
327 #ifndef dg_configUSE_BOD
328 #define dg_configUSE_BOD (1)
329 #endif
330 
338 #ifndef dg_configWDOG_RESET_VALUE
339 #define dg_configWDOG_RESET_VALUE (0xFF)
340 #endif
341 
350 #ifndef dg_configWDOG_NOTIFY_TRIGGER_TMO
351 #define dg_configWDOG_NOTIFY_TRIGGER_TMO (0)
352 #endif
353 
362 #ifndef dg_configABORT_IF_SYSTICK_CLK_ERR
363 #define dg_configABORT_IF_SYSTICK_CLK_ERR (0)
364 #endif
365 
374 #ifndef dg_configPM_MAX_ADAPTERS_CNT
375 #define dg_configPM_MAX_ADAPTERS_CNT (16)
376 #endif
377 
387 #ifndef dg_configPM_MAX_ADAPTER_DEFER_TIME
388 # if ((dg_configUSE_LP_CLK == LP_CLK_32000) || (dg_configUSE_LP_CLK == LP_CLK_32768))
389 # define dg_configPM_MAX_ADAPTER_DEFER_TIME (128)
390 # elif (dg_configUSE_LP_CLK == LP_CLK_RCX)
391 # define dg_configPM_MAX_ADAPTER_DEFER_TIME cm_rcx_us_2_lpcycles(4000)
392 # else /* LP_CLK_ANY */
393  /* Must be defined in the custom_config_<>.h file. It should be > 3.5msec. */
394 # endif
395 #endif
396 
402 #ifndef dg_configUSE_DCDC
403 #define dg_configUSE_DCDC (1)
404 #endif
405 
416 #ifndef dg_configUSE_ADC_GAIN_ERROR_CORRECTION
417 #define dg_configUSE_ADC_GAIN_ERROR_CORRECTION (1)
418 #endif
419 
430 #if (dg_configEXEC_MODE != MODE_IS_MIRRORED)
431 # undef dg_configIMAGE_COPY_TIME
432 # define dg_configIMAGE_COPY_TIME (0)
433 #elif !defined(dg_configIMAGE_COPY_TIME)
434 # if ((dg_configUSE_LP_CLK == LP_CLK_32000) || (dg_configUSE_LP_CLK == LP_CLK_32768))
435 # define dg_configIMAGE_COPY_TIME (64)
436 # elif (dg_configUSE_LP_CLK == LP_CLK_RCX)
437 # define dg_configIMAGE_COPY_TIME cm_rcx_us_2_lpcycles(1950)
438 # else /* LP_CLK_ANY */
439  /* Must be defined in the custom_config_<>.h file. */
440 # endif
441 #endif
442 
443 /*
444  * \brief Trimmed Configuration Script
445  *
446  * Enabling this feature the system will always use the trimmed configuration values
447  * stored by the TCS in OTP
448  *
449  * - 1: used
450  * - 0: not used
451  */
452 #ifndef dg_configUSE_SYS_TCS
453 #define dg_configUSE_SYS_TCS (1)
454 #endif
455 
462 #ifndef dg_configTESTMODE_MEASURE_SLEEP_CURRENT
463 #define dg_configTESTMODE_MEASURE_SLEEP_CURRENT (0)
464 #endif
465 
475 #ifndef dg_configRETAIN_HOT_CODE
476 #define dg_configRETAIN_HOT_CODE (0)
477 #endif /* dg_configRETAIN_HOT_CODE */
478 
483 /* ----------------------------------- Flash Configuration -------------------------------------- */
484 
498 #ifndef dg_configFLASH_POWER_DOWN
499 #define dg_configFLASH_POWER_DOWN (0)
500 #endif
501 
502 /* Backward compatibility check */
503 
504 #if defined(dg_configPOWER_FLASH) || defined(dg_configFLASH_POWER_OFF)
505 #define PRINT_POWER_RAIL_SETUP
506 #endif
507 
516 #ifndef dg_configQSPI_FLASH_AUTODETECT
517 #define dg_configQSPI_FLASH_AUTODETECT (0)
518 #endif
519 
520 
528 #ifndef dg_configQSPI_MEMORY_CONFIG_TABLE_HEADER
529 #define dg_configQSPI_MEMORY_CONFIG_TABLE_HEADER "qspi_memory_config_table_internal.h"
530 #endif
531 
545 #ifndef dg_configQSPI_FLASH_AUTODETECT_RESET_DELAY
546 #define dg_configQSPI_FLASH_AUTODETECT_RESET_DELAY (12000)
547 #endif
548 
554 #ifndef dg_configIMAGE_FLASH_OFFSET
555 #define dg_configIMAGE_FLASH_OFFSET (0)
556 #endif
557 
563 #ifndef dg_configQSPI_FLASH_MAX_WRITE_SIZE
564 #define dg_configQSPI_FLASH_MAX_WRITE_SIZE (128)
565 #endif
566 
567 
579 #ifndef dg_configQSPI_AUTOMODE_ENABLE
580 #if (dg_configCODE_LOCATION == NON_VOLATILE_IS_QSPI_FLASH)
581 #define dg_configQSPI_AUTOMODE_ENABLE (1)
582 #elif ( (dg_configCODE_LOCATION == NON_VOLATILE_IS_EMBEDDED_FLASH) || (dg_configCODE_LOCATION == NON_VOLATILE_IS_NONE) )
583 #define dg_configQSPI_AUTOMODE_ENABLE (0)
584 #endif
585 #endif
586 
591 /* ----------------------------------- Cache Configuration -------------------------------------- */
592 
616 #ifndef dg_configCACHEABLE_QSPI_AREA_LEN
617 #define dg_configCACHEABLE_QSPI_AREA_LEN (-1)
618 #endif
619 
631 #ifndef dg_configCACHE_ASSOCIATIVITY
632 #define dg_configCACHE_ASSOCIATIVITY (2)
633 #endif
634 
646 #ifndef dg_configCACHE_LINESZ
647 #define dg_configCACHE_LINESZ (0)
648 #endif
649 
654 /* ----------------------------------- UART settings -------------------------------------------- */
655 
669 #ifndef dg_configUART_SOFTWARE_FIFO
670 #define dg_configUART_SOFTWARE_FIFO (0)
671 #endif
672 
678 #ifndef dg_configUART1_SOFTWARE_FIFO_SIZE
679 #define dg_configUART1_SOFTWARE_FIFO_SIZE (0)
680 #endif
681 
687 #ifndef dg_configUART2_SOFTWARE_FIFO_SIZE
688 #define dg_configUART2_SOFTWARE_FIFO_SIZE (0)
689 #endif
690 
696 #ifndef dg_configUART_RX_CIRCULAR_DMA
697 #define dg_configUART_RX_CIRCULAR_DMA (0)
698 #endif
699 
705 #ifndef dg_configUART1_RX_CIRCULAR_DMA_BUF_SIZE
706 #define dg_configUART1_RX_CIRCULAR_DMA_BUF_SIZE (0)
707 #endif
708 
714 #ifndef dg_configUART2_RX_CIRCULAR_DMA_BUF_SIZE
715 #define dg_configUART2_RX_CIRCULAR_DMA_BUF_SIZE (0)
716 #endif
717 
722 /* ----------------------------------- I2C settings -------------------------------------------- */
723 
745 #ifndef dg_configI2C_ENABLE_STATUS_INTERVAL
746 #define dg_configI2C_ENABLE_STATUS_INTERVAL (100)
747 #endif
748 
753 /* ----------------------------------- RF Configuration ----------------------------------------- */
754 
768 #if defined(CONFIG_USE_BLE)
769 # ifndef dg_configRF_ENABLE_RECALIBRATION
770 # define dg_configRF_ENABLE_RECALIBRATION (1)
771 # endif
772 #endif
773 
778 /* ----------------------------------- DEVICE-SPECIFIC CONFIGURATION ---------------------------- */
779 
780 
781 #include "bsp_defaults_da1459x.h"
782 
783 
784 /* ----------------------------------- DEBUG CONFIGURATION -------------------------------------- */
785 
786 #include "bsp_debug.h"
787 
788 /* ----------------------------------- MEMORY LAYOUT CONFIGURATION ------------------------------ */
789 
790 #include "bsp_memory_defaults.h"
791 
792 
793 #endif /* BSP_DEFAULTS_H_ */
794 
bsp_debug.h
Board Support Package. Debug Configuration.
bsp_memory_defaults.h
Board Support Package. Memory Configuration file default values.
bsp_defaults_da1459x.h
Board Support Package. Device-specific system configuration default values.