Files
microchip-application-bmd38…/app_config.h
T
chain40 bc92926b0f add le_dis_c
1. discovery device info service
2. dis client handling events from the database discovery module
3. reading different characteristics from DIS, and show with segger rtt
2023-06-03 23:10:53 +08:00

216 lines
8.9 KiB
C

#pragma once
#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
// 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 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 1
// 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_EDC_15RE 0x00020107
#define DEF_ELITE_EDC_15R2 0x00020108
#define DEF_ELITE_EIS_10 0x00040100
#define DEF_ELITE_EIS_11 0x00040101
#define DEF_ELITE_EIS_MINI_10 0x00040102
#define LE_DEVICE_NAME "CENRAL"
#define MAJOR_PRODUCT_NUMBER 0
#define MINOR_PRODUCT_NUMBER 1
#define MAJOR_VERSION_NUMBER 0
#define MINOR_VERSION_NUMBER 1
#define ELITE_DEVICE_NAME_LIST \
{ \
"EIS", "EDC" \
}
#define ELITE_COMPANY_CODE "Elite"
#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 0
// Maximum number of central links.
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
// 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 Scanning Module
#define NRF_BLE_SCAN_ENABLED 1
// Set Data length for an advertising set.
#define NRF_BLE_SCAN_BUFFER 31
#define NRF_BLE_SCAN_NAME_MAX_LEN 32
#define NRF_BLE_SCAN_SHORT_NAME_MAX_LEN 32
// Priority for dispatching the BLE events to the Scanning Module.
#define NRF_BLE_SCAN_OBSERVER_PRIO 1
// Scanning interval. Determines the scan interval in units of 0.625 millisecond.
#define NRF_BLE_SCAN_SCAN_INTERVAL 160
// Duration of a scanning session in units of 10 ms. Range: 0x0001 - 0xFFFF (10 ms to 10.9225 ms). If set to 0x0000, the scanning continues until it is explicitly disabled.
#define NRF_BLE_SCAN_SCAN_DURATION 0
// Scanning window. Determines the scanning window in units of 0.625 millisecond.
#define NRF_BLE_SCAN_SCAN_WINDOW 80
// Determines the supervision time-out in units of 10 millisecond.
#define NRF_BLE_SCAN_SUPERVISION_TIMEOUT 4000
// Determines minimum connection interval in milliseconds.
#define NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL 7.5
// Determines maximum connection interval in milliseconds.
#define NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL 20
// Determines the slave latency in counts of connection events.
#define NRF_BLE_SCAN_SLAVE_LATENCY 0
// Enabling filters for the Scanning Module.
#define NRF_BLE_SCAN_FILTER_ENABLE 1
// Number of filters for UUIDs.
#define NRF_BLE_SCAN_UUID_CNT 0
// Number of name filters.
#define NRF_BLE_SCAN_NAME_CNT 2
// Number of short name filters.
#define NRF_BLE_SCAN_SHORT_NAME_CNT 0
// Number of address filters.
#define NRF_BLE_SCAN_ADDRESS_CNT 0
// Number of appearance filters.
#define NRF_BLE_SCAN_APPEARANCE_CNT 0
// A tag identifying the SoftDevice BLE configuration.
#define APP_BLE_CONN_CFG_TAG 1
#define NRF_BLE_GQ_ENABLED 1
// Default size of a single element in the pool of memory objects.
#define NRF_BLE_GQ_DATAPOOL_ELEMENT_SIZE 20
// Default number of elements in the pool of memory objects.
#define NRF_BLE_GQ_DATAPOOL_ELEMENT_COUNT 8
// Maximal size of the data inside GATTC write request (in bytes).
#define NRF_BLE_GQ_GATTC_WRITE_MAX_DATA_LEN 2
// Maximal size of the data inside GATTC notification or indication request (in bytes).
#define NRF_BLE_GQ_GATTS_HVX_MAX_DATA_LEN 16
// Queue size for BLE GATT Queue module.
#define NRF_BLE_GQ_QUEUE_SIZE 6
// Priority with which BLE events are dispatched to the GATT Queue module.
#define NRF_BLE_GQ_BLE_OBSERVER_PRIO 1
// Enable Queue module
#define NRF_QUEUE_ENABLED 1
// Enable Database discovery module
#define BLE_DB_DISCOVERY_ENABLED 1
// Priority with which BLE events are dispatched to the Database Discovery module.
#define BLE_DB_DISC_BLE_OBSERVER_PRIO 1
// Enable Device Information Client module
#define BLE_DIS_C_ENABLED 1
// Priority with which BLE events are dispatched to the Device Information Client.
#define BLE_DIS_C_BLE_OBSERVER_PRIO 1
#define COUNTOF(x) (sizeof(x) / sizeof(x[0]))
#ifdef __cplusplus
}
#endif
#endif // !__APP_CONFIG_H__