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