konashi/SBBLEのテスト

Dependencies:   BLE_API mbed

Fork of BLE_LoopbackUART by Bluetooth Low Energy

Committer:
robo8080
Date:
Sun Aug 17 00:53:23 2014 +0000
Revision:
8:a62b8f7d5dcf
Parent:
6:9c9630cb454b
DeviceName??

Who changed what in which revision?

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