library for BLE_GAP_backpack

Dependencies:   nrf51-sdk

Fork of nRF51822 by Nordic Semiconductor

Committer:
rgrover1
Date:
Mon Jul 06 10:21:00 2015 +0100
Revision:
372:758e9a3a346a
Child:
583:3e44f6eb3a42
Synchronized with git rev 488e2462
Author: James Crosby
restructure to yotta module, with a few tweaks to get things building

Who changed what in which revision?

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