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