mirror of
https://github.com/tsl0922/EPD-nRF5.git
synced 2025-12-09 16:08:13 +08:00
510 lines
11 KiB
C
510 lines
11 KiB
C
|
|
|
|
#ifndef SDK_CONFIG_H
|
|
#define SDK_CONFIG_H
|
|
// <<< Use Configuration Wizard in Context Menu >>>\n
|
|
#ifdef USE_APP_CONFIG
|
|
#include "app_config.h"
|
|
#endif
|
|
// <h> nRF_Drivers
|
|
|
|
//==========================================================
|
|
// <e> CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver
|
|
//==========================================================
|
|
#ifndef CLOCK_ENABLED
|
|
#define CLOCK_ENABLED 0
|
|
#endif
|
|
#if CLOCK_ENABLED
|
|
// <o> CLOCK_CONFIG_XTAL_FREQ - HF XTAL Frequency
|
|
|
|
// <0=> Default (64 MHz)
|
|
// <255=> Default (16 MHz)
|
|
// <0=> 32 MHz
|
|
|
|
#ifndef CLOCK_CONFIG_XTAL_FREQ
|
|
#define CLOCK_CONFIG_XTAL_FREQ 255
|
|
#endif
|
|
|
|
// <o> CLOCK_CONFIG_LF_SRC - LF Clock Source
|
|
|
|
// <0=> RC
|
|
// <1=> XTAL
|
|
// <2=> Synth
|
|
|
|
#ifndef CLOCK_CONFIG_LF_SRC
|
|
#define CLOCK_CONFIG_LF_SRC 1
|
|
#endif
|
|
|
|
// <o> CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority
|
|
|
|
|
|
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
|
|
// <0=> 0 (highest)
|
|
// <1=> 1
|
|
// <2=> 2
|
|
// <3=> 3
|
|
|
|
#ifndef CLOCK_CONFIG_IRQ_PRIORITY
|
|
#define CLOCK_CONFIG_IRQ_PRIORITY 3
|
|
#endif
|
|
|
|
// <e> CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module.
|
|
//==========================================================
|
|
#ifndef CLOCK_CONFIG_LOG_ENABLED
|
|
#define CLOCK_CONFIG_LOG_ENABLED 0
|
|
#endif
|
|
#if CLOCK_CONFIG_LOG_ENABLED
|
|
// <o> CLOCK_CONFIG_LOG_LEVEL - Default Severity level
|
|
|
|
// <0=> Off
|
|
// <1=> Error
|
|
// <2=> Warning
|
|
// <3=> Info
|
|
// <4=> Debug
|
|
|
|
#ifndef CLOCK_CONFIG_LOG_LEVEL
|
|
#define CLOCK_CONFIG_LOG_LEVEL 3
|
|
#endif
|
|
|
|
// <o> CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef CLOCK_CONFIG_INFO_COLOR
|
|
#define CLOCK_CONFIG_INFO_COLOR 0
|
|
#endif
|
|
|
|
// <o> CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef CLOCK_CONFIG_DEBUG_COLOR
|
|
#define CLOCK_CONFIG_DEBUG_COLOR 0
|
|
#endif
|
|
|
|
#endif //CLOCK_CONFIG_LOG_ENABLED
|
|
// </e>
|
|
|
|
#endif //CLOCK_ENABLED
|
|
// </e>
|
|
|
|
// <e> PERIPHERAL_RESOURCE_SHARING_ENABLED - nrf_drv_common - Peripheral drivers common module
|
|
//==========================================================
|
|
#ifndef PERIPHERAL_RESOURCE_SHARING_ENABLED
|
|
#define PERIPHERAL_RESOURCE_SHARING_ENABLED 0
|
|
#endif
|
|
#if PERIPHERAL_RESOURCE_SHARING_ENABLED
|
|
// <e> COMMON_CONFIG_LOG_ENABLED - Enables logging in the module.
|
|
//==========================================================
|
|
#ifndef COMMON_CONFIG_LOG_ENABLED
|
|
#define COMMON_CONFIG_LOG_ENABLED 0
|
|
#endif
|
|
#if COMMON_CONFIG_LOG_ENABLED
|
|
// <o> COMMON_CONFIG_LOG_LEVEL - Default Severity level
|
|
|
|
// <0=> Off
|
|
// <1=> Error
|
|
// <2=> Warning
|
|
// <3=> Info
|
|
// <4=> Debug
|
|
|
|
#ifndef COMMON_CONFIG_LOG_LEVEL
|
|
#define COMMON_CONFIG_LOG_LEVEL 3
|
|
#endif
|
|
|
|
// <o> COMMON_CONFIG_INFO_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef COMMON_CONFIG_INFO_COLOR
|
|
#define COMMON_CONFIG_INFO_COLOR 0
|
|
#endif
|
|
|
|
// <o> COMMON_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef COMMON_CONFIG_DEBUG_COLOR
|
|
#define COMMON_CONFIG_DEBUG_COLOR 0
|
|
#endif
|
|
|
|
#endif //COMMON_CONFIG_LOG_ENABLED
|
|
// </e>
|
|
|
|
#endif //PERIPHERAL_RESOURCE_SHARING_ENABLED
|
|
// </e>
|
|
|
|
// <e> RNG_ENABLED - nrf_drv_rng - RNG peripheral driver
|
|
//==========================================================
|
|
#ifndef RNG_ENABLED
|
|
#define RNG_ENABLED 1
|
|
#endif
|
|
#if RNG_ENABLED
|
|
// <q> RNG_CONFIG_ERROR_CORRECTION - Error correction
|
|
|
|
|
|
#ifndef RNG_CONFIG_ERROR_CORRECTION
|
|
#define RNG_CONFIG_ERROR_CORRECTION 0
|
|
#endif
|
|
|
|
// <o> RNG_CONFIG_POOL_SIZE - Pool size
|
|
#ifndef RNG_CONFIG_POOL_SIZE
|
|
#define RNG_CONFIG_POOL_SIZE 32
|
|
#endif
|
|
|
|
// <o> RNG_CONFIG_IRQ_PRIORITY - Interrupt priority
|
|
|
|
|
|
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
|
|
// <0=> 0 (highest)
|
|
// <1=> 1
|
|
// <2=> 2
|
|
// <3=> 3
|
|
|
|
#ifndef RNG_CONFIG_IRQ_PRIORITY
|
|
#define RNG_CONFIG_IRQ_PRIORITY 3
|
|
#endif
|
|
|
|
// <e> RNG_CONFIG_LOG_ENABLED - Enables logging in the module.
|
|
//==========================================================
|
|
#ifndef RNG_CONFIG_LOG_ENABLED
|
|
#define RNG_CONFIG_LOG_ENABLED 0
|
|
#endif
|
|
#if RNG_CONFIG_LOG_ENABLED
|
|
// <o> RNG_CONFIG_LOG_LEVEL - Default Severity level
|
|
|
|
// <0=> Off
|
|
// <1=> Error
|
|
// <2=> Warning
|
|
// <3=> Info
|
|
// <4=> Debug
|
|
|
|
#ifndef RNG_CONFIG_LOG_LEVEL
|
|
#define RNG_CONFIG_LOG_LEVEL 3
|
|
#endif
|
|
|
|
// <o> RNG_CONFIG_INFO_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef RNG_CONFIG_INFO_COLOR
|
|
#define RNG_CONFIG_INFO_COLOR 0
|
|
#endif
|
|
|
|
// <o> RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef RNG_CONFIG_DEBUG_COLOR
|
|
#define RNG_CONFIG_DEBUG_COLOR 0
|
|
#endif
|
|
|
|
#endif //RNG_CONFIG_LOG_ENABLED
|
|
// </e>
|
|
|
|
#endif //RNG_ENABLED
|
|
// </e>
|
|
|
|
// </h>
|
|
//==========================================================
|
|
|
|
// <h> nRF_Libraries
|
|
|
|
//==========================================================
|
|
// <e> APP_SCHEDULER_ENABLED - app_scheduler - Events scheduler
|
|
//==========================================================
|
|
#ifndef APP_SCHEDULER_ENABLED
|
|
#define APP_SCHEDULER_ENABLED 1
|
|
#endif
|
|
#if APP_SCHEDULER_ENABLED
|
|
// <q> APP_SCHEDULER_WITH_PAUSE - Enabling pause feature
|
|
|
|
|
|
#ifndef APP_SCHEDULER_WITH_PAUSE
|
|
#define APP_SCHEDULER_WITH_PAUSE 0
|
|
#endif
|
|
|
|
// <q> APP_SCHEDULER_WITH_PROFILER - Enabling scheduler profiling
|
|
|
|
|
|
#ifndef APP_SCHEDULER_WITH_PROFILER
|
|
#define APP_SCHEDULER_WITH_PROFILER 0
|
|
#endif
|
|
|
|
#endif //APP_SCHEDULER_ENABLED
|
|
// </e>
|
|
|
|
// <e> APP_TIMER_ENABLED - app_timer - Application timer functionality
|
|
//==========================================================
|
|
#ifndef APP_TIMER_ENABLED
|
|
#define APP_TIMER_ENABLED 1
|
|
#endif
|
|
#if APP_TIMER_ENABLED
|
|
// <q> APP_TIMER_WITH_PROFILER - Enable app_timer profiling
|
|
|
|
|
|
#ifndef APP_TIMER_WITH_PROFILER
|
|
#define APP_TIMER_WITH_PROFILER 0
|
|
#endif
|
|
|
|
// <q> APP_TIMER_KEEPS_RTC_ACTIVE - Enable RTC always on
|
|
|
|
|
|
// <i> If option is enabled RTC is kept running even if there is no active timers.
|
|
// <i> This option can be used when app_timer is used for timestamping.
|
|
|
|
#ifndef APP_TIMER_KEEPS_RTC_ACTIVE
|
|
#define APP_TIMER_KEEPS_RTC_ACTIVE 0
|
|
#endif
|
|
|
|
#endif //APP_TIMER_ENABLED
|
|
// </e>
|
|
|
|
// <q> CRC32_ENABLED - crc32 - CRC32 calculation routines
|
|
|
|
|
|
#ifndef CRC32_ENABLED
|
|
#define CRC32_ENABLED 1
|
|
#endif
|
|
|
|
// <q> ECC_ENABLED - ecc - Elliptic Curve Cryptography Library
|
|
|
|
|
|
#ifndef ECC_ENABLED
|
|
#define ECC_ENABLED 0
|
|
#endif
|
|
|
|
// <e> FSTORAGE_ENABLED - fstorage - Flash storage module
|
|
//==========================================================
|
|
#ifndef FSTORAGE_ENABLED
|
|
#define FSTORAGE_ENABLED 1
|
|
#endif
|
|
#if FSTORAGE_ENABLED
|
|
// <o> FS_QUEUE_SIZE - Configures the size of the internal queue.
|
|
// <i> Increase this if there are many users, or if it is likely that many
|
|
// <i> operation will be queued at once without waiting for the previous operations
|
|
// <i> to complete. In general, increase the queue size if you frequently receive
|
|
// <i> @ref FS_ERR_QUEUE_FULL errors when calling @ref fs_store or @ref fs_erase.
|
|
|
|
#ifndef FS_QUEUE_SIZE
|
|
#define FS_QUEUE_SIZE 4
|
|
#endif
|
|
|
|
// <o> FS_OP_MAX_RETRIES - Number attempts to execute an operation if the SoftDevice fails.
|
|
// <i> Increase this value if events return the @ref FS_ERR_OPERATION_TIMEOUT
|
|
// <i> error often. The SoftDevice may fail to schedule flash access due to high BLE activity.
|
|
|
|
#ifndef FS_OP_MAX_RETRIES
|
|
#define FS_OP_MAX_RETRIES 3
|
|
#endif
|
|
|
|
// <o> FS_MAX_WRITE_SIZE_WORDS - Maximum number of words to be written to flash in a single operation.
|
|
// <i> Tweaking this value can increase the chances of the SoftDevice being
|
|
// <i> able to fit flash operations in between radio activity. This value is bound by the
|
|
// <i> maximum number of words which the SoftDevice can write to flash in a single call to
|
|
// <i> @ref sd_flash_write, which is 256 words for nRF51 ICs and 1024 words for nRF52 ICs.
|
|
|
|
#ifndef FS_MAX_WRITE_SIZE_WORDS
|
|
#define FS_MAX_WRITE_SIZE_WORDS 256
|
|
#endif
|
|
|
|
#endif //FSTORAGE_ENABLED
|
|
// </e>
|
|
|
|
// <e> HCI_MEM_POOL_ENABLED - hci_mem_pool - memory pool implementation used by HCI
|
|
//==========================================================
|
|
#ifndef HCI_MEM_POOL_ENABLED
|
|
#define HCI_MEM_POOL_ENABLED 1
|
|
#endif
|
|
#if HCI_MEM_POOL_ENABLED
|
|
// <o> HCI_TX_BUF_SIZE - TX buffer size in bytes.
|
|
#ifndef HCI_TX_BUF_SIZE
|
|
#define HCI_TX_BUF_SIZE 600
|
|
#endif
|
|
|
|
// <o> HCI_RX_BUF_SIZE - RX buffer size in bytes.
|
|
#ifndef HCI_RX_BUF_SIZE
|
|
#define HCI_RX_BUF_SIZE 600
|
|
#endif
|
|
|
|
// <o> HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size.
|
|
#ifndef HCI_RX_BUF_QUEUE_SIZE
|
|
#define HCI_RX_BUF_QUEUE_SIZE 4
|
|
#endif
|
|
|
|
#endif //HCI_MEM_POOL_ENABLED
|
|
// </e>
|
|
|
|
// <q> NRF_QUEUE_ENABLED - nrf_queue - Queue module
|
|
|
|
|
|
#ifndef NRF_QUEUE_ENABLED
|
|
#define NRF_QUEUE_ENABLED 1
|
|
#endif
|
|
|
|
// </h>
|
|
//==========================================================
|
|
|
|
// <h> nRF_Log
|
|
|
|
//==========================================================
|
|
// <e> NRF_LOG_ENABLED - nrf_log - Logging
|
|
//==========================================================
|
|
#ifndef NRF_LOG_ENABLED
|
|
#define NRF_LOG_ENABLED 0
|
|
#endif
|
|
#if NRF_LOG_ENABLED
|
|
// <e> NRF_LOG_USES_COLORS - If enabled then ANSI escape code for colors is prefixed to every string
|
|
//==========================================================
|
|
#ifndef NRF_LOG_USES_COLORS
|
|
#define NRF_LOG_USES_COLORS 0
|
|
#endif
|
|
#if NRF_LOG_USES_COLORS
|
|
// <o> NRF_LOG_COLOR_DEFAULT - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef NRF_LOG_COLOR_DEFAULT
|
|
#define NRF_LOG_COLOR_DEFAULT 0
|
|
#endif
|
|
|
|
// <o> NRF_LOG_ERROR_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef NRF_LOG_ERROR_COLOR
|
|
#define NRF_LOG_ERROR_COLOR 0
|
|
#endif
|
|
|
|
// <o> NRF_LOG_WARNING_COLOR - ANSI escape code prefix.
|
|
|
|
// <0=> Default
|
|
// <1=> Black
|
|
// <2=> Red
|
|
// <3=> Green
|
|
// <4=> Yellow
|
|
// <5=> Blue
|
|
// <6=> Magenta
|
|
// <7=> Cyan
|
|
// <8=> White
|
|
|
|
#ifndef NRF_LOG_WARNING_COLOR
|
|
#define NRF_LOG_WARNING_COLOR 0
|
|
#endif
|
|
|
|
#endif //NRF_LOG_USES_COLORS
|
|
// </e>
|
|
|
|
// <o> NRF_LOG_DEFAULT_LEVEL - Default Severity level
|
|
|
|
// <0=> Off
|
|
// <1=> Error
|
|
// <2=> Warning
|
|
// <3=> Info
|
|
// <4=> Debug
|
|
|
|
#ifndef NRF_LOG_DEFAULT_LEVEL
|
|
#define NRF_LOG_DEFAULT_LEVEL 3
|
|
#endif
|
|
|
|
// <e> NRF_LOG_DEFERRED - Enable deffered logger.
|
|
|
|
// <i> Log data is buffered and can be processed in idle.
|
|
//==========================================================
|
|
#ifndef NRF_LOG_DEFERRED
|
|
#define NRF_LOG_DEFERRED 1
|
|
#endif
|
|
#if NRF_LOG_DEFERRED
|
|
// <o> NRF_LOG_DEFERRED_BUFSIZE - Size of the buffer for logs in words.
|
|
// <i> Must be power of 2
|
|
|
|
#ifndef NRF_LOG_DEFERRED_BUFSIZE
|
|
#define NRF_LOG_DEFERRED_BUFSIZE 256
|
|
#endif
|
|
|
|
#endif //NRF_LOG_DEFERRED
|
|
// </e>
|
|
|
|
// <q> NRF_LOG_USES_TIMESTAMP - Enable timestamping
|
|
|
|
|
|
// <i> Function for getting the timestamp is provided by the user
|
|
|
|
#ifndef NRF_LOG_USES_TIMESTAMP
|
|
#define NRF_LOG_USES_TIMESTAMP 0
|
|
#endif
|
|
|
|
#endif //NRF_LOG_ENABLED
|
|
// </e>
|
|
|
|
// </h>
|
|
//==========================================================
|
|
|
|
// <<< end of configuration section >>>
|
|
#endif //SDK_CONFIG_H
|
|
|