121 lines
4.1 KiB
C
121 lines
4.1 KiB
C
#pragma once
|
|
#ifndef __APP_CONFIG_H__
|
|
#define __APP_CONFIG_H__
|
|
|
|
#define COUNTOF(x) (sizeof(x)/sizeof(x[0]))
|
|
|
|
// LOG
|
|
#define NRF_LOG_DEFAULT_LEVEL 4
|
|
#define NRF_LOG_BACKEND_RTT_ENABLED 1
|
|
#define NRF_LOG_BACKEND_UART_ENABLED 0
|
|
#define NRF_LOG_DEFERRED 0
|
|
#define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0
|
|
|
|
// SEGGER-RTT
|
|
#define SEGGER_RTT_SECTION ".segger_rtt"
|
|
#define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 1
|
|
#define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 1
|
|
#define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 4000
|
|
#define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16
|
|
|
|
#define NRF_SDH_CLOCK_LF_SRC 0
|
|
#define NRF_SDH_CLOCK_LF_RC_CTIV 12
|
|
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
|
|
#define NRF_SDH_CLOCK_LF_ACCURACY 1
|
|
|
|
// DFU
|
|
#define NRF_BL_DFU_ENTER_METHOD_BUTTON 0
|
|
#define NRF_BL_DFU_ENTER_METHOD_BUTTONLESS 1
|
|
#define NRF_BL_DFU_ALLOW_UPDATE_FROM_APP 1
|
|
#define NRF_DFU_SETTINGS_COMPATIBILITY_MODE 0
|
|
#define NRF_DFU_APP_DOWNGRADE_PREVENTION 0
|
|
#define NRF_DFU_APP_DATA_AREA_SIZE (CODE_PAGE_SIZE*4)
|
|
|
|
// DFU over BLE
|
|
#define NRF_DFU_TRANSPORT_BLE 1
|
|
|
|
// DFU over USBD
|
|
#define SLIP_ENABLED 1
|
|
#define NRF_DFU_SERIAL_USB_RX_BUFFERS 3
|
|
|
|
// USBD
|
|
#define NRFX_USBD_ENABLED 1
|
|
#define NRFX_USBD_CONFIG_IRQ_PRIORITY 6
|
|
#define NRFX_USBD_CONFIG_DMASCHEDULER_MODE 0
|
|
#define NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1
|
|
#define NRFX_USBD_CONFIG_ISO_IN_ZLP 0
|
|
#define NRFX_USBD_USE_WORKAROUND_FOR_ANOMALY_211 0
|
|
|
|
#define USBD_ENABLED 1
|
|
#define USBD_CONFIG_IRQ_PRIORITY 6
|
|
#define USBD_CONFIG_DMASCHEDULER_MODE 0
|
|
#define USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1
|
|
#define USBD_CONFIG_ISO_IN_ZLP 0
|
|
|
|
// USBD CDC
|
|
#define APP_USBD_CDC_ACM_ENABLED 1
|
|
#define APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE 1
|
|
#define APP_USBD_ENABLED 1
|
|
#define APP_USBD_VID 0x1915
|
|
#define APP_USBD_PID 0x521F
|
|
#define APP_USBD_DEVICE_VER_MAJOR 1
|
|
#define APP_USBD_DEVICE_VER_MINOR 0
|
|
#define APP_USBD_DEVICE_VER_SUB 0
|
|
#define APP_USBD_CONFIG_SELF_POWERED 1
|
|
#define APP_USBD_CONFIG_MAX_POWER 100
|
|
#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 1
|
|
#define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE 0
|
|
#define APP_USBD_CONFIG_EVENT_QUEUE_SIZE 32
|
|
#define APP_USBD_CONFIG_SOF_HANDLING_MODE 1
|
|
#define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE 0
|
|
#define APP_USBD_CONFIG_DESC_STRING_SIZE 31
|
|
#define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED 0
|
|
#define APP_USBD_STRINGS_LANGIDS APP_USBD_LANG_AND_SUBLANG(APP_USBD_LANG_ENGLISH, APP_USBD_SUBLANG_ENGLISH_US)
|
|
#define APP_USBD_STRING_ID_MANUFACTURER 1
|
|
#define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0
|
|
#define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRING_DESC("Nordic Semiconductor")
|
|
#define APP_USBD_STRING_ID_PRODUCT 2
|
|
#define APP_USBD_STRINGS_PRODUCT_EXTERN 0
|
|
#define APP_USBD_STRINGS_PRODUCT APP_USBD_STRING_DESC("Secure DFU Bootloader")
|
|
#define APP_USBD_STRING_ID_SERIAL 3
|
|
#define APP_USBD_STRING_SERIAL_EXTERN 1
|
|
#define APP_USBD_STRING_SERIAL g_extern_serial_number
|
|
#define APP_USBD_STRING_ID_CONFIGURATION 4
|
|
#define APP_USBD_STRING_CONFIGURATION_EXTERN 0
|
|
#define APP_USBD_STRINGS_CONFIGURATION APP_USBD_STRING_DESC("Default configuration")
|
|
#define APP_USBD_STRINGS_USER X(APP_USER_1, , APP_USBD_STRING_DESC("User 1"))
|
|
|
|
// Power & Clock
|
|
#define NRFX_POWER_ENABLED 1
|
|
#define NRFX_POWER_CONFIG_IRQ_PRIORITY 6
|
|
#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0
|
|
#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0
|
|
#define POWER_ENABLED 1
|
|
#define POWER_CONFIG_IRQ_PRIORITY 6
|
|
#define POWER_CONFIG_DEFAULT_DCDCEN 0
|
|
#define POWER_CONFIG_DEFAULT_DCDCENHV 0
|
|
#define NRFX_CLOCK_CONFIG_LF_SRC 0
|
|
#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6
|
|
#define NRF_CLOCK_ENABLED 1
|
|
#define CLOCK_CONFIG_IRQ_PRIORITY 6
|
|
|
|
#define LED_SOFTBLINK_ENABLED 1
|
|
#define NRF_SORTLIST_ENABLED 1
|
|
#define LOW_POWER_PWM_ENABLED 1
|
|
|
|
#define APP_TIMER_V2_RTC1_ENABLED 1
|
|
#define APP_TIMER_WITH_PROFILER 0
|
|
#define APP_TIMER_CONFIG_USE_SCHEDULER 0
|
|
#define APP_TIMER_CONFIG_IRQ_PRIORITY 6
|
|
#define APP_TIMER_CONFIG_RTC_FREQUENCY 0
|
|
#define APP_TIMER_CONFIG_OP_QUEUE_SIZE 10
|
|
#define APP_TIMER_SAFE_WINDOW_MS (30 * 1000)
|
|
#define APP_TIMER_KEEPS_RTC_ACTIVE 1
|
|
|
|
#define DFU_LED_CONFIG_TRANSPORT_ACTIVE_BREATH_MS 300
|
|
#define DFU_LED_CONFIG_TRANSPORT_INACTIVE_BREATH_MS 600
|
|
#define DFU_LED_CONFIG_PROGRESS_BLINK_MS 100
|
|
|
|
#endif // !__APP_CONFIG_H__
|
|
|