library for BLE_GAP_backpack

Dependencies:   nrf51-sdk

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers projectconfig.h Source File

projectconfig.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2006-2013 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef _PROJECTCONFIG_H_
00018 #define _PROJECTCONFIG_H_
00019 
00020 #include "ble/GapAdvertisingData.h"
00021 
00022 /*=========================================================================
00023     MCU & BOARD SELCTION
00024 
00025     CFG_BOARD is one of the value defined in board.h
00026     -----------------------------------------------------------------------*/
00027     #define CFG_BOARD                                  BOARD_PCA10001
00028     #define CFG_MCU_STRING                             "nRF51822"
00029 /*=========================================================================*/
00030 
00031 
00032 /*=========================================================================
00033     CODE BASE VERSION SETTINGS
00034 
00035     Please do not modify this version number.  To set a version number
00036     for your project or firmware, change the values in your 'boards/'
00037     config file.
00038     -----------------------------------------------------------------------*/
00039     #define CFG_CODEBASE_VERSION_MAJOR                 0
00040     #define CFG_CODEBASE_VERSION_MINOR                 1
00041     #define CFG_CODEBASE_VERSION_REVISION              0
00042 /*=========================================================================*/
00043 
00044 
00045 /*=========================================================================
00046     FIRMWARE VERSION SETTINGS
00047     -----------------------------------------------------------------------*/
00048     #define CFG_FIRMWARE_VERSION_MAJOR                 0
00049     #define CFG_FIRMWARE_VERSION_MINOR                 0
00050     #define CFG_FIRMWARE_VERSION_REVISION              0
00051 /*=========================================================================*/
00052 
00053 
00054 /*=========================================================================
00055     DEBUG LEVEL
00056     -----------------------------------------------------------------------
00057 
00058     CFG_DEBUG                 Level 3: Full debug output, any failed assert
00059                                        will produce a breakpoint for the
00060                                        debugger
00061                               Level 2: ATTR_ALWAYS_INLINE is null, ASSERT
00062                                        has text
00063                               Level 1: ATTR_ALWAYS_INLINE is an attribute,
00064                                        ASSERT has no text
00065                               Level 0: No debug information generated
00066 
00067     -----------------------------------------------------------------------*/
00068     #define CFG_DEBUG                                  (0)
00069 
00070     #if (CFG_DEBUG > 3) || (CFG_DEBUG < 0)
00071       #error "CFG_DEBUG must be a value between 0 (no debug) and 3"
00072     #endif
00073 /*=========================================================================*/
00074 
00075 
00076 /*=========================================================================
00077     GENERAL NRF51 PERIPHERAL SETTINGS
00078     -----------------------------------------------------------------------
00079 
00080     CFG_SCHEDULER_ENABLE      Set this to 'true' or 'false' depending on
00081                               if you use the event scheduler or not
00082 
00083     -----------------------------------------------------------------------*/
00084     #define CFG_SCHEDULER_ENABLE                       false
00085 
00086     /*------------------------------- GPIOTE ------------------------------*/
00087     #define CFG_GPIOTE_MAX_USERS                       1                        /**< Maximum number of users of the GPIOTE handler. */
00088 
00089     /*-------------------------------- TIMER ------------------------------*/
00090     #define CFG_TIMER_PRESCALER                        0                        /**< Value of the RTC1 PRESCALER register. freq = (32768/(PRESCALER+1)) */
00091     #define CFG_TIMER_MAX_INSTANCE                     1                        /**< Maximum number of simultaneously created timers. */
00092     #define CFG_TIMER_OPERATION_QUEUE_SIZE             2                        /**< Size of timer operation queues. */
00093 /*=========================================================================*/
00094 
00095 
00096 /*=========================================================================
00097     BTLE SETTINGS
00098     -----------------------------------------------------------------------*/
00099 
00100     #define CFG_BLE_TX_POWER_LEVEL                     0                        /**< in dBm (Valid values are -40, -20, -16, -12, -8, -4, 0, 4) */
00101 
00102     /*---------------------------- BOND MANAGER ---------------------------*/
00103     #define CFG_BLE_BOND_FLASH_PAGE_BOND               (BLE_FLASH_PAGE_END-1)   /**< Flash page used for bond manager bonding information.*/
00104     #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*/
00105     #define CFG_BLE_BOND_DELETE_BUTTON_NUM             0                        /**< Button to press to delete bond details during init */
00106 
00107     /*------------------------------ SECURITY -----------------------------*/
00108     #define CFG_BLE_SEC_PARAM_MITM                     0                        /**< Man In The Middle protection not required. */
00109     #define CFG_BLE_SEC_PARAM_IO_CAPABILITIES          BLE_GAP_IO_CAPS_NONE     /**< No I/O capabilities. */
00110     #define CFG_BLE_SEC_PARAM_OOB                      0                        /**< Out Of Band data not available. */
00111     #define CFG_BLE_SEC_PARAM_MIN_KEY_SIZE             7                        /**< Minimum encryption key size. */
00112     #define CFG_BLE_SEC_PARAM_MAX_KEY_SIZE             16
00113 
00114     /*--------------------------------- GAP -------------------------------*/
00115     #define CFG_GAP_APPEARANCE                         GapAdvertisingData::GENERIC_TAG
00116     #define CFG_GAP_LOCAL_NAME                         "nRF5x"
00117 
00118     #define CFG_GAP_CONNECTION_MIN_INTERVAL_MS           50                     /**< Minimum acceptable connection interval */
00119     #define CFG_GAP_CONNECTION_MAX_INTERVAL_MS          500                     /**< Maximum acceptable connection interval */
00120     #define CFG_GAP_CONNECTION_SUPERVISION_TIMEOUT_MS  4000                     /**< Connection supervisory timeout */
00121     #define CFG_GAP_CONNECTION_SLAVE_LATENCY           0                        /**< Slave Latency in number of connection events. */
00122 
00123     #define CFG_GAP_ADV_INTERVAL_MS                    250                       /**< The advertising interval in miliseconds, should be multiply of 0.625 */
00124     #define CFG_GAP_ADV_TIMEOUT_S                      180                      /**< The advertising timeout in units of seconds. */
00125 /*=========================================================================*/
00126 
00127 
00128 /*=========================================================================
00129     VALIDATION
00130     -----------------------------------------------------------------------*/
00131     #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
00132         #error "CFG_BLE_TX_POWER_LEVEL must be -40, -20, -16, -12, -8, -4, 0 or 4"
00133     #endif
00134 /*=========================================================================*/
00135 
00136 #endif /* _PROJECTCONFIG_H_ */