#ifndef __APP_CONFIG_H__ #define __APP_CONFIG_H__ #ifdef __cplusplus extern "C" { #endif // LOG #define NRF_LOG_ENABLED 1 #define NRF_LOG_DEFAULT_LEVEL 3 #define NRF_LOG_BACKEND_RTT_ENABLED 1 #define NRF_LOG_BACKEND_UART_ENABLED 0 #define NRF_LOG_BACKEND_RTT_TX_RETRY_DELAY_MS 1 #define NRF_LOG_BACKEND_RTT_TX_RETRY_CNT 3 #define NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE 64 #define NRF_LOG_DEFERRED 0 #define NRF_LOG_USES_TIMESTAMP 0 #define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0 #define NRF_LOG_MSGPOOL_ELEMENT_COUNT 31 // SEGGER-RTT #define SEGGER_RTT_SECTION ".segger_rtt" #define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 2 #define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 1 #define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 2048 #define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16 #define SEGGER_RTT_CONFIG_DEFAULT_MODE 0 // SoftDevice SoC event handler #define NRF_SDH_SOC_ENABLED 1 // SoftDevice handler #define NRF_SDH_ENABLED 1 // SoftDevice clock configuration #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 // SDH Observers - Observers and priority levels #define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2 #define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2 #define NRF_SDH_STACK_OBSERVER_PRIO_LEVELS 2 // SoC Observers - Observers and priority levels #define NRF_SDH_SOC_OBSERVER_PRIO_LEVELS 2 // nrf_drv_power - POWER peripheral driver - legacy layer #define POWER_ENABLED 1 // The default configuration of main DCDC regulator #define POWER_CONFIG_DEFAULT_DCDCEN 0 // The default configuration of High Voltage DCDC regulator #define POWER_CONFIG_DEFAULT_DCDCENHV 0 // nrf_drv_clock - CLOCK peripheral driver - legacy layer #define NRF_CLOCK_ENABLED 1 // LF Clock Source #define CLOCK_CONFIG_LF_SRC 0 #define CLOCK_CONFIG_LF_CAL_ENABLED 0 // nrf_section_iter - Section iterator #define NRF_SECTION_ITER_ENABLED 1 // State Observers priorities #define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0 #define POWER_CONFIG_STATE_OBSERVER_PRIO 0 #define RNG_CONFIG_STATE_OBSERVER_PRIO 0 // Stack Event Observers priorities #define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0 #define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0 // SoC Observers priorities #define POWER_CONFIG_SOC_OBSERVER_PRIO 0 #define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0 // Interrupt priority #define POWER_CONFIG_IRQ_PRIORITY 6 #define CLOCK_CONFIG_IRQ_PRIORITY 6 // SoftDevice BLE event handler #define NRF_SDH_BLE_ENABLED 1 // The number of vendor-specific UUIDs. #define NRF_SDH_BLE_VS_UUID_COUNT 2 // Attribute Table size in bytes. The size must be a multiple of 4. #define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408 // BLE Observers - Observers and priority levels #define NRF_SDH_BLE_OBSERVER_PRIO_LEVELS 4 // Include the Service Changed characteristic in the Attribute Table. #define NRF_SDH_BLE_SERVICE_CHANGED 1 // This setting configures how Stack events are dispatched to the application. #define NRF_SDH_DISPATCH_MODEL 2 /* SoftDevice events are to be fetched manually. */ // BLE Observers priorities - Invididual priorities #define BLE_ADV_BLE_OBSERVER_PRIO 1 #define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 1 #define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0 // Enable Advertising module #define BLE_ADVERTISING_ENABLED 1 // BLE device name #define DEF_ELITE_DEV 0x00000000 #define DEF_ELITE_EDC_V2_0 0x00020109 #define DEF_ELITE_PEL_V2_0 0x00070001 #define DEF_ELITE_CPG_V1_1 0x00080001 #define DEF_ELITE_MODEL DEF_ELITE_PEL_V2_0 #define DEF_ELITE_DEMO_W_SOFTDEVICE 0 #if (DEF_ELITE_MODEL == DEF_ELITE_DEV) #define ELITE_DEVICE_NAME "Elite-Dev" #define ELITE_HW_NAME "Elite-Dev" #define MAJOR_PRODUCT_NUMBER 0 #define MINOR_PRODUCT_NUMBER 0 #define MAJOR_VERSION_NUMBER 0 #define MINOR_VERSION_NUMBER 0 #define DEF_TW1508_ENABLED 0 #define DEF_LED_COUNT 0 #define DEF_LED_DRV_ENABLED 0 #define DEF_APA102_2020_ENABLED 0 #define DEF_ADC_DRV_ENABLED 0 #define DEF_ADS8691_ENABLED 0 #define DEF_BULTIN_ADC_ENABED 0 #define DEF_DAC_DRV_ENABLED 0 #define DEF_MAX5136_ENABLED 0 #define DEF_SW_DRV_ENABLED 0 #define DEF_MAX14802_ENABLED 0 #define DEF_ADGS1412_ENABLED 0 #define DEF_FS_ENABLED 0 #define DEF_FS_RTT_DIR 0 #define DEF_GD25D10C_ENABLED 0 #define DEF_BTN_ENABLED 0 #define DEF_RTT_JSCOP_ENABLED 0 #elif (DEF_ELITE_MODEL == DEF_ELITE_EDC_V2_0) #define ELITE_DEVICE_NAME "Elite-EDC" #define ELITE_HW_NAME "Elite-EDCv2.0" #define MAJOR_PRODUCT_NUMBER 0 #define MINOR_PRODUCT_NUMBER 2 #define MAJOR_VERSION_NUMBER 1 #define MINOR_VERSION_NUMBER 9 #define DEF_TW1508_ENABLED 0 #define DEF_LED_COUNT 12 #define DEF_LED_DRV_ENABLED 1 #define DEF_APA102_2020_ENABLED 1 #define DEF_ADC_DRV_ENABLED 1 #define DEF_ADS8691_ENABLED 1 #define DEF_BULTIN_ADC_ENABED 0 #define DEF_DAC_DRV_ENABLED 1 #define DEF_MAX5136_ENABLED 1 #define DEF_SW_DRV_ENABLED 1 #define DEF_MAX14802_ENABLED 0 #define DEF_ADGS1412_ENABLED 1 #define DEF_FS_ENABLED 0 #define DEF_FS_RTT_DIR 0 #define DEF_GD25D10C_ENABLED 0 #define DEF_BTN_ENABLED 1 #define DEF_RTT_JSCOP_ENABLED 0 #elif (DEF_ELITE_MODEL == DEF_ELITE_PEL_V2_0) #define ELITE_DEVICE_NAME "Elite-PEL" #define ELITE_HW_NAME "Elite-PELv2.0" #define MAJOR_PRODUCT_NUMBER 0 #define MINOR_PRODUCT_NUMBER 7 #define MAJOR_VERSION_NUMBER 0 #define MINOR_VERSION_NUMBER 1 #define DEF_TW1508_ENABLED 0 #define DEF_LED_COUNT 0 #define DEF_LED_DRV_ENABLED 0 #define DEF_APA102_2020_ENABLED 0 #define DEF_ADC_DRV_ENABLED 1 #define DEF_ADS8691_ENABLED 0 #define DEF_BULTIN_ADC_ENABED 1 #define DEF_DAC_DRV_ENABLED 0 #define DEF_MAX5136_ENABLED 0 #define DEF_SW_DRV_ENABLED 0 #define DEF_MAX14802_ENABLED 0 #define DEF_ADGS1412_ENABLED 0 #define DEF_FS_ENABLED 0 #define DEF_FS_RTT_DIR 0 #define DEF_GD25D10C_ENABLED 0 #define DEF_BTN_ENABLED 0 #define DEF_RTT_JSCOP_ENABLED 0 #elif (DEF_ELITE_MODEL == DEF_ELITE_CPG_V1_1) #define ELITE_DEVICE_NAME "Elite-CPG" #define ELITE_HW_NAME "Elite-CPGv1.1" #define MAJOR_PRODUCT_NUMBER 0 #define MINOR_PRODUCT_NUMBER 8 #define MAJOR_VERSION_NUMBER 0 #define MINOR_VERSION_NUMBER 1 #define DEF_TW1508_ENABLED 1 #define DEF_LED_COUNT 0 #define DEF_LED_DRV_ENABLED 0 #define DEF_APA102_2020_ENABLED 0 #define DEF_ADC_DRV_ENABLED 0 #define DEF_ADS8691_ENABLED 0 #define DEF_BULTIN_ADC_ENABED 0 #define DEF_DAC_DRV_ENABLED 0 #define DEF_MAX5136_ENABLED 0 #define DEF_SW_DRV_ENABLED 1 #define DEF_MAX14802_ENABLED 1 #define DEF_ADGS1412_ENABLED 0 #define DEF_FS_ENABLED 0 #define DEF_FS_RTT_DIR 0 #define DEF_GD25D10C_ENABLED 0 #define DEF_BTN_ENABLED 0 #define DEF_RTT_JSCOP_ENABLED 0 #endif #define BLE_ELITE_SRV_ENABLED 1 #define BLE_ELITE_OBSERVER_PRIO 3 #define ELITE_UUID 0xFFF0 #define ELITE_COMPANY_CODE "BPHS" #define ELITE_HW_VER \ { \ MAJOR_PRODUCT_NUMBER, MINOR_PRODUCT_NUMBER, MAJOR_VERSION_NUMBER, MINOR_VERSION_NUMBER \ } // Maximum number of peripheral links. #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1 // Maximum number of central links. #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0 // Total link count. #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 // Enable GATT module. #define NRF_BLE_GATT_ENABLED 1 // Priority with which BLE events are dispatched to the GATT module. #define NRF_BLE_GATT_BLE_OBSERVER_PRIO 1 // Requested BLE GAP data length to be negotiated. #define NRF_SDH_BLE_GAP_DATA_LENGTH 251 // GAP event length. The time set aside for this connection on every connection interval in 1.25 ms units. #define NRF_SDH_BLE_GAP_EVENT_LENGTH (0xFFFF) // Static maximum MTU size. #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247 // Enable ble device info module #define BLE_DIS_ENABLED 1 // DFU #define NRF_DFU_TRANSPORT_BLE 1 #define BLE_DFU_BLE_OBSERVER_PRIO 2 #define NRF_PWR_MGMT_ENABLED 1 // Enable spim #define SPI_ENABLED 1 #define SPI1_ENABLED 1 #define SPI1_USE_EASY_DMA 1 #define SPI2_ENABLED 1 #define SPI2_USE_EASY_DMA 1 #define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 7 #define NRFX_SPIM_MISO_PULL_CFG 3 // Enable twi(i2c) #define TWI_ENABLED 1 #define TWI0_ENABLED 1 #define TWI0_USE_EASY_DMA 1 // Enable gpiote #define NRFX_GPIOTE_ENABLED 1 #define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 #define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6 #define COUNT_ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define COUNTOF(x) (sizeof(x) / sizeof(x[0])) #define UNCONNECTED_PIN 0xFFFFFFFF #define u8_to_u32(a, b, c, d) (((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | (d)) #define u8_to_u16(a, b) (((uint16_t)(a) << 8) | (b)) #define u8_to_i32(a, b, c, d) (((int32_t)(a) << 24) | ((int32_t)(b) << 16) | ((int32_t)(c) << 8) | ((int32_t)(d))) #define u8_to_i16(a, b) (((int16_t)(a) << 8) | (int16_t)(b)) #ifdef __cplusplus } #endif #endif /* ! __APP_CONFIG_H__ */