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