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