テスト用です。

Dependencies:   mbed

Committer:
jksoft
Date:
Tue Oct 11 11:09:42 2016 +0000
Revision:
0:8468a4403fea
SB??ver;

Who changed what in which revision?

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