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