hr with 30102

Dependencies:   BLE_API mbed X_NUCLEO_IDB0XA1

Fork of BLE_HeartRate by Bluetooth Low Energy

Committer:
mssarwar
Date:
Sun Jul 30 05:52:57 2017 +0000
Revision:
80:808f6f367f45
with 30102;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mssarwar 80:808f6f367f45 1 /* mbed Microcontroller Library
mssarwar 80:808f6f367f45 2 * Copyright (c) 2006-2013 ARM Limited
mssarwar 80:808f6f367f45 3 *
mssarwar 80:808f6f367f45 4 * Licensed under the Apache License, Version 2.0 (the "License");
mssarwar 80:808f6f367f45 5 * you may not use this file except in compliance with the License.
mssarwar 80:808f6f367f45 6 * You may obtain a copy of the License at
mssarwar 80:808f6f367f45 7 *
mssarwar 80:808f6f367f45 8 * http://www.apache.org/licenses/LICENSE-2.0
mssarwar 80:808f6f367f45 9 *
mssarwar 80:808f6f367f45 10 * Unless required by applicable law or agreed to in writing, software
mssarwar 80:808f6f367f45 11 * distributed under the License is distributed on an "AS IS" BASIS,
mssarwar 80:808f6f367f45 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mssarwar 80:808f6f367f45 13 * See the License for the specific language governing permissions and
mssarwar 80:808f6f367f45 14 * limitations under the License.
mssarwar 80:808f6f367f45 15 */
mssarwar 80:808f6f367f45 16
mssarwar 80:808f6f367f45 17 #ifndef _PROJECTCONFIG_H_
mssarwar 80:808f6f367f45 18 #define _PROJECTCONFIG_H_
mssarwar 80:808f6f367f45 19
mssarwar 80:808f6f367f45 20 #include "ble/GapAdvertisingData.h"
mssarwar 80:808f6f367f45 21
mssarwar 80:808f6f367f45 22 /*=========================================================================
mssarwar 80:808f6f367f45 23 MCU & BOARD SELCTION
mssarwar 80:808f6f367f45 24
mssarwar 80:808f6f367f45 25 CFG_BOARD is one of the value defined in board.h
mssarwar 80:808f6f367f45 26 -----------------------------------------------------------------------*/
mssarwar 80:808f6f367f45 27 #define CFG_BOARD BOARD_PCA10001
mssarwar 80:808f6f367f45 28 #define CFG_MCU_STRING "nRF51822"
mssarwar 80:808f6f367f45 29 /*=========================================================================*/
mssarwar 80:808f6f367f45 30
mssarwar 80:808f6f367f45 31
mssarwar 80:808f6f367f45 32 /*=========================================================================
mssarwar 80:808f6f367f45 33 CODE BASE VERSION SETTINGS
mssarwar 80:808f6f367f45 34
mssarwar 80:808f6f367f45 35 Please do not modify this version number. To set a version number
mssarwar 80:808f6f367f45 36 for your project or firmware, change the values in your 'boards/'
mssarwar 80:808f6f367f45 37 config file.
mssarwar 80:808f6f367f45 38 -----------------------------------------------------------------------*/
mssarwar 80:808f6f367f45 39 #define CFG_CODEBASE_VERSION_MAJOR 0
mssarwar 80:808f6f367f45 40 #define CFG_CODEBASE_VERSION_MINOR 1
mssarwar 80:808f6f367f45 41 #define CFG_CODEBASE_VERSION_REVISION 0
mssarwar 80:808f6f367f45 42 /*=========================================================================*/
mssarwar 80:808f6f367f45 43
mssarwar 80:808f6f367f45 44
mssarwar 80:808f6f367f45 45 /*=========================================================================
mssarwar 80:808f6f367f45 46 FIRMWARE VERSION SETTINGS
mssarwar 80:808f6f367f45 47 -----------------------------------------------------------------------*/
mssarwar 80:808f6f367f45 48 #define CFG_FIRMWARE_VERSION_MAJOR 0
mssarwar 80:808f6f367f45 49 #define CFG_FIRMWARE_VERSION_MINOR 0
mssarwar 80:808f6f367f45 50 #define CFG_FIRMWARE_VERSION_REVISION 0
mssarwar 80:808f6f367f45 51 /*=========================================================================*/
mssarwar 80:808f6f367f45 52
mssarwar 80:808f6f367f45 53
mssarwar 80:808f6f367f45 54 /*=========================================================================
mssarwar 80:808f6f367f45 55 DEBUG LEVEL
mssarwar 80:808f6f367f45 56 -----------------------------------------------------------------------
mssarwar 80:808f6f367f45 57
mssarwar 80:808f6f367f45 58 CFG_DEBUG Level 3: Full debug output, any failed assert
mssarwar 80:808f6f367f45 59 will produce a breakpoint for the
mssarwar 80:808f6f367f45 60 debugger
mssarwar 80:808f6f367f45 61 Level 2: ATTR_ALWAYS_INLINE is null, ASSERT
mssarwar 80:808f6f367f45 62 has text
mssarwar 80:808f6f367f45 63 Level 1: ATTR_ALWAYS_INLINE is an attribute,
mssarwar 80:808f6f367f45 64 ASSERT has no text
mssarwar 80:808f6f367f45 65 Level 0: No debug information generated
mssarwar 80:808f6f367f45 66
mssarwar 80:808f6f367f45 67 -----------------------------------------------------------------------*/
mssarwar 80:808f6f367f45 68 #define CFG_DEBUG (1)
mssarwar 80:808f6f367f45 69
mssarwar 80:808f6f367f45 70 #if (CFG_DEBUG > 3) || (CFG_DEBUG < 0)
mssarwar 80:808f6f367f45 71 #error "CFG_DEBUG must be a value between 0 (no debug) and 3"
mssarwar 80:808f6f367f45 72 #endif
mssarwar 80:808f6f367f45 73 /*=========================================================================*/
mssarwar 80:808f6f367f45 74
mssarwar 80:808f6f367f45 75
mssarwar 80:808f6f367f45 76 /*=========================================================================
mssarwar 80:808f6f367f45 77 GENERAL NRF51 PERIPHERAL SETTINGS
mssarwar 80:808f6f367f45 78 -----------------------------------------------------------------------
mssarwar 80:808f6f367f45 79
mssarwar 80:808f6f367f45 80 CFG_SCHEDULER_ENABLE Set this to 'true' or 'false' depending on
mssarwar 80:808f6f367f45 81 if you use the event scheduler or not
mssarwar 80:808f6f367f45 82
mssarwar 80:808f6f367f45 83 -----------------------------------------------------------------------*/
mssarwar 80:808f6f367f45 84 #define CFG_SCHEDULER_ENABLE false
mssarwar 80:808f6f367f45 85
mssarwar 80:808f6f367f45 86 /*------------------------------- GPIOTE ------------------------------*/
mssarwar 80:808f6f367f45 87 #define CFG_GPIOTE_MAX_USERS 1 /**< Maximum number of users of the GPIOTE handler. */
mssarwar 80:808f6f367f45 88
mssarwar 80:808f6f367f45 89 /*-------------------------------- TIMER ------------------------------*/
mssarwar 80:808f6f367f45 90 #define CFG_TIMER_PRESCALER 0 /**< Value of the RTC1 PRESCALER register. freq = (32768/(PRESCALER+1)) */
mssarwar 80:808f6f367f45 91 #define CFG_TIMER_MAX_INSTANCE 1 /**< Maximum number of simultaneously created timers. */
mssarwar 80:808f6f367f45 92 #define CFG_TIMER_OPERATION_QUEUE_SIZE 2 /**< Size of timer operation queues. */
mssarwar 80:808f6f367f45 93 /*=========================================================================*/
mssarwar 80:808f6f367f45 94
mssarwar 80:808f6f367f45 95
mssarwar 80:808f6f367f45 96 /*=========================================================================
mssarwar 80:808f6f367f45 97 BTLE SETTINGS
mssarwar 80:808f6f367f45 98 -----------------------------------------------------------------------*/
mssarwar 80:808f6f367f45 99
mssarwar 80:808f6f367f45 100 #define CFG_BLE_TX_POWER_LEVEL 0 /**< in dBm (Valid values are -40, -20, -16, -12, -8, -4, 0, 4) */
mssarwar 80:808f6f367f45 101
mssarwar 80:808f6f367f45 102 /*---------------------------- BOND MANAGER ---------------------------*/
mssarwar 80:808f6f367f45 103 #define CFG_BLE_BOND_FLASH_PAGE_BOND (BLE_FLASH_PAGE_END-1) /**< Flash page used for bond manager bonding information.*/
mssarwar 80:808f6f367f45 104 #define CFG_BLE_BOND_FLASH_PAGE_SYS_ATTR (BLE_FLASH_PAGE_END-3) /**< Flash page used for bond manager system attribute information. TODO check if we can use BLE_FLASH_PAGE_END-2*/
mssarwar 80:808f6f367f45 105 #define CFG_BLE_BOND_DELETE_BUTTON_NUM 0 /**< Button to press to delete bond details during init */
mssarwar 80:808f6f367f45 106
mssarwar 80:808f6f367f45 107 /*------------------------------ SECURITY -----------------------------*/
mssarwar 80:808f6f367f45 108 #define CFG_BLE_SEC_PARAM_MITM 0 /**< Man In The Middle protection not required. */
mssarwar 80:808f6f367f45 109 #define CFG_BLE_SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */
mssarwar 80:808f6f367f45 110 #define CFG_BLE_SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
mssarwar 80:808f6f367f45 111 #define CFG_BLE_SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
mssarwar 80:808f6f367f45 112 #define CFG_BLE_SEC_PARAM_MAX_KEY_SIZE 16
mssarwar 80:808f6f367f45 113
mssarwar 80:808f6f367f45 114 /*--------------------------------- GAP -------------------------------*/
mssarwar 80:808f6f367f45 115 #define CFG_GAP_APPEARANCE GapAdvertisingData::GENERIC_TAG
mssarwar 80:808f6f367f45 116 #define CFG_GAP_LOCAL_NAME "nRF5x"
mssarwar 80:808f6f367f45 117
mssarwar 80:808f6f367f45 118 #define CFG_GAP_CONNECTION_MIN_INTERVAL_MS 50 /**< Minimum acceptable connection interval */
mssarwar 80:808f6f367f45 119 #define CFG_GAP_CONNECTION_MAX_INTERVAL_MS 500 /**< Maximum acceptable connection interval */
mssarwar 80:808f6f367f45 120 #define CFG_GAP_CONNECTION_SUPERVISION_TIMEOUT_MS 4000 /**< Connection supervisory timeout */
mssarwar 80:808f6f367f45 121 #define CFG_GAP_CONNECTION_SLAVE_LATENCY 0 /**< Slave Latency in number of connection events. */
mssarwar 80:808f6f367f45 122
mssarwar 80:808f6f367f45 123 #define CFG_GAP_ADV_INTERVAL_MS 25 /**< The advertising interval in miliseconds, should be multiply of 0.625 */
mssarwar 80:808f6f367f45 124 #define CFG_GAP_ADV_TIMEOUT_S 180 /**< The advertising timeout in units of seconds. */
mssarwar 80:808f6f367f45 125 /*=========================================================================*/
mssarwar 80:808f6f367f45 126
mssarwar 80:808f6f367f45 127
mssarwar 80:808f6f367f45 128 /*=========================================================================
mssarwar 80:808f6f367f45 129 VALIDATION
mssarwar 80:808f6f367f45 130 -----------------------------------------------------------------------*/
mssarwar 80:808f6f367f45 131 #if CFG_BLE_TX_POWER_LEVEL != -40 && CFG_BLE_TX_POWER_LEVEL != -20 && CFG_BLE_TX_POWER_LEVEL != -16 && CFG_BLE_TX_POWER_LEVEL != -12 && CFG_BLE_TX_POWER_LEVEL != -8 && CFG_BLE_TX_POWER_LEVEL != -4 && CFG_BLE_TX_POWER_LEVEL != 0 && CFG_BLE_TX_POWER_LEVEL != 4
mssarwar 80:808f6f367f45 132 #error "CFG_BLE_TX_POWER_LEVEL must be -40, -20, -16, -12, -8, -4, 0 or 4"
mssarwar 80:808f6f367f45 133 #endif
mssarwar 80:808f6f367f45 134 /*=========================================================================*/
mssarwar 80:808f6f367f45 135
mssarwar 80:808f6f367f45 136 #endif /* _PROJECTCONFIG_H_ */