テスト用

Fork of nRF51822 by Nordic Semiconductor

Committer:
Rohit Grover
Date:
Tue Jun 10 13:32:01 2014 +0100
Revision:
26:dade7d2857b4
Parent:
0:eff01767de02
Child:
53:1e5c300cec7f
Set CFG_DEBUG to 1 to stop ASSERT_MESSAGE() from calling printf.
This has a significant impact on code-size and on the use of BSS.

Who changed what in which revision?

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