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