microbit-dal
Dependencies: BLE_API mbed-dev-bin nRF51822
Fork of microbit-dal by
inc/platform/yotta_cfg_mappings.h@27:2f494ead23de, 2016-07-13 (annotated)
- Committer:
- LancasterUniversity
- Date:
- Wed Jul 13 12:18:05 2016 +0100
- Revision:
- 27:2f494ead23de
- Child:
- 63:b4372a29994f
Synchronized with git rev 8875dc35
Author: James Devine
microbit-dal: added yotta configuration mappings to DAL specific configuration options.
Yotta can now be used to configure the configuration options for the
dal.
An full config.json looks like:
{
"microbit-dal":{
"bluetooth":{
"enabled": 1,
"pairing_mode": 0,
"private_addressing": 0,
"open": 0,
"whitelist": 1,
"advertising_timeout": 0,
"tx_power": 0,
"dfu_service": 1,
"event_service": 1,
"device_info_service": 1
},
"reuse_sd": 1,
"gatt_table_size": "0x300",
"heap_allocator": 1,
"nested_heap_proportion": 0.75,
"system_tick_period": 6,
"system_components": 10,
"idle_components": 6,
"use_accel_lsb": 0,
"min_display_brightness": 1,
"max_display_brightness": 255,
"display_scroll_speed": 120,
"display_scroll_stride": -1,
"display_print_speed": 400,
"panic_on_heap_full": 1,
"debug": 0,
"heap_debug": 0,
"stack_size":2048,
"sram_base":"0x20000008",
"sram_end":"0x20004000",
"sd_limit":"0x20002000",
"gatt_table_start":"0x20001900"
}
}
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LancasterUniversity | 27:2f494ead23de | 1 | #ifndef YOTTA_CFG_MAPPINGS_H |
LancasterUniversity | 27:2f494ead23de | 2 | #define YOTTA_CFG_MAPPINGS_H |
LancasterUniversity | 27:2f494ead23de | 3 | |
LancasterUniversity | 27:2f494ead23de | 4 | /** |
LancasterUniversity | 27:2f494ead23de | 5 | * This header file contains mappings from a yotta config.json file for the DAL, |
LancasterUniversity | 27:2f494ead23de | 6 | * to DAL specific #defines used in the DAL. |
LancasterUniversity | 27:2f494ead23de | 7 | */ |
LancasterUniversity | 27:2f494ead23de | 8 | |
LancasterUniversity | 27:2f494ead23de | 9 | //DAL mappings |
LancasterUniversity | 27:2f494ead23de | 10 | #ifdef YOTTA_CFG_MICROBIT_DAL_HEAP_ALLOCATOR |
LancasterUniversity | 27:2f494ead23de | 11 | #define MICROBIT_HEAP_ALLOCATOR YOTTA_CFG_MICROBIT_DAL_HEAP_ALLOCATOR |
LancasterUniversity | 27:2f494ead23de | 12 | #endif |
LancasterUniversity | 27:2f494ead23de | 13 | |
LancasterUniversity | 27:2f494ead23de | 14 | #ifdef YOTTA_CFG_MICROBIT_DAL_NESTED_HEAP_PROPORTION |
LancasterUniversity | 27:2f494ead23de | 15 | #define MICROBIT_NESTED_HEAP_SIZE YOTTA_CFG_MICROBIT_DAL_NESTED_HEAP_PROPORTION |
LancasterUniversity | 27:2f494ead23de | 16 | #endif |
LancasterUniversity | 27:2f494ead23de | 17 | |
LancasterUniversity | 27:2f494ead23de | 18 | #ifdef YOTTA_CFG_MICROBIT_DAL_REUSE_SD |
LancasterUniversity | 27:2f494ead23de | 19 | #define MICROBIT_HEAP_REUSE_SD YOTTA_CFG_MICROBIT_DAL_REUSE_SD |
LancasterUniversity | 27:2f494ead23de | 20 | #endif |
LancasterUniversity | 27:2f494ead23de | 21 | |
LancasterUniversity | 27:2f494ead23de | 22 | #ifdef YOTTA_CFG_MICROBIT_DAL_GATT_TABLE_SIZE |
LancasterUniversity | 27:2f494ead23de | 23 | #define MICROBIT_SD_GATT_TABLE_SIZE YOTTA_CFG_MICROBIT_DAL_GATT_TABLE_SIZE |
LancasterUniversity | 27:2f494ead23de | 24 | #endif |
LancasterUniversity | 27:2f494ead23de | 25 | |
LancasterUniversity | 27:2f494ead23de | 26 | #ifdef YOTTA_CFG_MICROBIT_DAL_SYSTEM_TICK_PERIOD |
LancasterUniversity | 27:2f494ead23de | 27 | #define SYSTEM_TICK_PERIOD_MS YOTTA_CFG_MICROBIT_DAL_SYSTEM_TICK_PERIOD |
LancasterUniversity | 27:2f494ead23de | 28 | #endif |
LancasterUniversity | 27:2f494ead23de | 29 | |
LancasterUniversity | 27:2f494ead23de | 30 | #ifdef YOTTA_CFG_MICROBIT_DAL_SYSTEM_COMPONENTS |
LancasterUniversity | 27:2f494ead23de | 31 | #define MICROBIT_SYSTEM_COMPONENTS YOTTA_CFG_MICROBIT_DAL_SYSTEM_COMPONENTS |
LancasterUniversity | 27:2f494ead23de | 32 | #endif |
LancasterUniversity | 27:2f494ead23de | 33 | |
LancasterUniversity | 27:2f494ead23de | 34 | #ifdef YOTTA_CFG_MICROBIT_DAL_IDLE_COMPONENTS |
LancasterUniversity | 27:2f494ead23de | 35 | #define MICROBIT_IDLE_COMPONENTS YOTTA_CFG_MICROBIT_DAL_IDLE_COMPONENTS |
LancasterUniversity | 27:2f494ead23de | 36 | #endif |
LancasterUniversity | 27:2f494ead23de | 37 | |
LancasterUniversity | 27:2f494ead23de | 38 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_ENABLED |
LancasterUniversity | 27:2f494ead23de | 39 | #define MICROBIT_BLE_ENABLED YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_ENABLED |
LancasterUniversity | 27:2f494ead23de | 40 | #endif |
LancasterUniversity | 27:2f494ead23de | 41 | |
LancasterUniversity | 27:2f494ead23de | 42 | #ifdef YOTTA_CFG_MICROBIT_DAL_USE_ACCEL_LSB |
LancasterUniversity | 27:2f494ead23de | 43 | #define USE_ACCEL_LSB YOTTA_CFG_MICROBIT_DAL_USE_ACCEL_LSB |
LancasterUniversity | 27:2f494ead23de | 44 | #endif |
LancasterUniversity | 27:2f494ead23de | 45 | |
LancasterUniversity | 27:2f494ead23de | 46 | #ifdef YOTTA_CFG_MICROBIT_DAL_MIN_DISPLAY_BRIGHTNESS |
LancasterUniversity | 27:2f494ead23de | 47 | #define MICROBIT_DISPLAY_MINIMUM_BRIGHTNESS YOTTA_CFG_MICROBIT_DAL_MIN_DISPLAY_BRIGHTNESS |
LancasterUniversity | 27:2f494ead23de | 48 | #endif |
LancasterUniversity | 27:2f494ead23de | 49 | |
LancasterUniversity | 27:2f494ead23de | 50 | #ifdef YOTTA_CFG_MICROBIT_DAL_MAX_DISPLAY_BRIGHTNESS |
LancasterUniversity | 27:2f494ead23de | 51 | #define MICROBIT_DISPLAY_MAXIMUM_BRIGHTNESS YOTTA_CFG_MICROBIT_DAL_MAX_DISPLAY_BRIGHTNESS |
LancasterUniversity | 27:2f494ead23de | 52 | #endif |
LancasterUniversity | 27:2f494ead23de | 53 | |
LancasterUniversity | 27:2f494ead23de | 54 | #ifdef YOTTA_CFG_MICROBIT_DAL_DISPLAY_SCROLL_SPEED |
LancasterUniversity | 27:2f494ead23de | 55 | #define MICROBIT_DEFAULT_SCROLL_SPEED YOTTA_CFG_MICROBIT_DAL_DISPLAY_SCROLL_SPEED |
LancasterUniversity | 27:2f494ead23de | 56 | #endif |
LancasterUniversity | 27:2f494ead23de | 57 | |
LancasterUniversity | 27:2f494ead23de | 58 | #ifdef YOTTA_CFG_MICROBIT_DAL_DISPLAY_SCROLL_STRIDE |
LancasterUniversity | 27:2f494ead23de | 59 | #define MICROBIT_DEFAULT_SCROLL_STRIDE YOTTA_CFG_MICROBIT_DAL_DISPLAY_SCROLL_STRIDE |
LancasterUniversity | 27:2f494ead23de | 60 | #endif |
LancasterUniversity | 27:2f494ead23de | 61 | |
LancasterUniversity | 27:2f494ead23de | 62 | #ifdef YOTTA_CFG_MICROBIT_DAL_DISPLAY_PRINT_SPEED |
LancasterUniversity | 27:2f494ead23de | 63 | #define MICROBIT_DEFAULT_PRINT_SPEED YOTTA_CFG_MICROBIT_DAL_DISPLAY_PRINT_SPEED |
LancasterUniversity | 27:2f494ead23de | 64 | #endif |
LancasterUniversity | 27:2f494ead23de | 65 | |
LancasterUniversity | 27:2f494ead23de | 66 | #ifdef YOTTA_CFG_MICROBIT_DAL_PANIC_ON_HEAP_FULL |
LancasterUniversity | 27:2f494ead23de | 67 | #define MICROBIT_PANIC_HEAP_FULL YOTTA_CFG_MICROBIT_DAL_PANIC_ON_HEAP_FULL |
LancasterUniversity | 27:2f494ead23de | 68 | #endif |
LancasterUniversity | 27:2f494ead23de | 69 | |
LancasterUniversity | 27:2f494ead23de | 70 | #ifdef YOTTA_CFG_MICROBIT_DAL_DEBUG |
LancasterUniversity | 27:2f494ead23de | 71 | #define MICROBIT_DBG YOTTA_CFG_MICROBIT_DAL_DEBUG |
LancasterUniversity | 27:2f494ead23de | 72 | #endif |
LancasterUniversity | 27:2f494ead23de | 73 | |
LancasterUniversity | 27:2f494ead23de | 74 | #ifdef YOTTA_CFG_MICROBIT_DAL_HEAP_DEBUG |
LancasterUniversity | 27:2f494ead23de | 75 | #define MICROBIT_HEAP_DBG YOTTA_CFG_MICROBIT_DAL_HEAP_DEBUG |
LancasterUniversity | 27:2f494ead23de | 76 | #endif |
LancasterUniversity | 27:2f494ead23de | 77 | |
LancasterUniversity | 27:2f494ead23de | 78 | #ifdef YOTTA_CFG_MICROBIT_DAL_STACK_SIZE |
LancasterUniversity | 27:2f494ead23de | 79 | #define MICROBIT_STACK_SIZE YOTTA_CFG_MICROBIT_DAL_STACK_SIZE |
LancasterUniversity | 27:2f494ead23de | 80 | #endif |
LancasterUniversity | 27:2f494ead23de | 81 | |
LancasterUniversity | 27:2f494ead23de | 82 | #ifdef YOTTA_CFG_MICROBIT_DAL_SRAM_BASE |
LancasterUniversity | 27:2f494ead23de | 83 | #define MICROBIT_SRAM_BASE YOTTA_CFG_MICROBIT_DAL_SRAM_BASE |
LancasterUniversity | 27:2f494ead23de | 84 | #endif |
LancasterUniversity | 27:2f494ead23de | 85 | |
LancasterUniversity | 27:2f494ead23de | 86 | #ifdef YOTTA_CFG_MICROBIT_DAL_SRAM_END |
LancasterUniversity | 27:2f494ead23de | 87 | #define MICROBIT_SRAM_END YOTTA_CFG_MICROBIT_DAL_SRAM_END |
LancasterUniversity | 27:2f494ead23de | 88 | #endif |
LancasterUniversity | 27:2f494ead23de | 89 | |
LancasterUniversity | 27:2f494ead23de | 90 | #ifdef YOTTA_CFG_MICROBIT_DAL_SD_LIMIT |
LancasterUniversity | 27:2f494ead23de | 91 | #define MICROBIT_SD_LIMIT YOTTA_CFG_MICROBIT_DAL_SD_LIMIT |
LancasterUniversity | 27:2f494ead23de | 92 | #endif |
LancasterUniversity | 27:2f494ead23de | 93 | |
LancasterUniversity | 27:2f494ead23de | 94 | #ifdef YOTTA_CFG_MICROBIT_DAL_GATT_TABLE_START |
LancasterUniversity | 27:2f494ead23de | 95 | #define MICROBIT_SD_GATT_TABLE_START YOTTA_CFG_MICROBIT_DAL_GATT_TABLE_START |
LancasterUniversity | 27:2f494ead23de | 96 | #endif |
LancasterUniversity | 27:2f494ead23de | 97 | |
LancasterUniversity | 27:2f494ead23de | 98 | |
LancasterUniversity | 27:2f494ead23de | 99 | //Bluetooth mappings |
LancasterUniversity | 27:2f494ead23de | 100 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PAIRING_MODE |
LancasterUniversity | 27:2f494ead23de | 101 | #define MICROBIT_BLE_PAIRING_MODE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PAIRING_MODE |
LancasterUniversity | 27:2f494ead23de | 102 | #endif |
LancasterUniversity | 27:2f494ead23de | 103 | |
LancasterUniversity | 27:2f494ead23de | 104 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PRIVATE_ADDRESSING |
LancasterUniversity | 27:2f494ead23de | 105 | #define MICROBIT_BLE_PRIVATE_ADDRESSES YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PRIVATE_ADDRESSING |
LancasterUniversity | 27:2f494ead23de | 106 | #endif |
LancasterUniversity | 27:2f494ead23de | 107 | |
LancasterUniversity | 27:2f494ead23de | 108 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_OPEN |
LancasterUniversity | 27:2f494ead23de | 109 | #define MICROBIT_BLE_OPEN YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_OPEN |
LancasterUniversity | 27:2f494ead23de | 110 | #endif |
LancasterUniversity | 27:2f494ead23de | 111 | |
LancasterUniversity | 27:2f494ead23de | 112 | |
LancasterUniversity | 27:2f494ead23de | 113 | //we check if the user has requested open mode, otherwise we will double def! |
LancasterUniversity | 27:2f494ead23de | 114 | #if (YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_OPEN == 0) |
LancasterUniversity | 27:2f494ead23de | 115 | |
LancasterUniversity | 27:2f494ead23de | 116 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_WHITELIST |
LancasterUniversity | 27:2f494ead23de | 117 | #define MICROBIT_BLE_WHITELIST YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_WHITELIST |
LancasterUniversity | 27:2f494ead23de | 118 | #endif |
LancasterUniversity | 27:2f494ead23de | 119 | |
LancasterUniversity | 27:2f494ead23de | 120 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_ADVERTISING_TIMEOUT |
LancasterUniversity | 27:2f494ead23de | 121 | #define MICROBIT_BLE_ADVERTISING_TIMEOUT YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_ADVERTISING_TIMEOUT |
LancasterUniversity | 27:2f494ead23de | 122 | #endif |
LancasterUniversity | 27:2f494ead23de | 123 | |
LancasterUniversity | 27:2f494ead23de | 124 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_TX_POWER |
LancasterUniversity | 27:2f494ead23de | 125 | #define MICROBIT_BLE_DEFAULT_TX_POWER YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_TX_POWER |
LancasterUniversity | 27:2f494ead23de | 126 | #endif |
LancasterUniversity | 27:2f494ead23de | 127 | |
LancasterUniversity | 27:2f494ead23de | 128 | #endif |
LancasterUniversity | 27:2f494ead23de | 129 | |
LancasterUniversity | 27:2f494ead23de | 130 | |
LancasterUniversity | 27:2f494ead23de | 131 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DFU_SERVICE |
LancasterUniversity | 27:2f494ead23de | 132 | #define MICROBIT_BLE_DFU_SERVICE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DFU_SERVICE |
LancasterUniversity | 27:2f494ead23de | 133 | #endif |
LancasterUniversity | 27:2f494ead23de | 134 | |
LancasterUniversity | 27:2f494ead23de | 135 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_EVENT_SERVICE |
LancasterUniversity | 27:2f494ead23de | 136 | #define MICROBIT_BLE_EVENT_SERVICE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_EVENT_SERVICE |
LancasterUniversity | 27:2f494ead23de | 137 | #endif |
LancasterUniversity | 27:2f494ead23de | 138 | |
LancasterUniversity | 27:2f494ead23de | 139 | #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DEVICE_INFO_SERVICE |
LancasterUniversity | 27:2f494ead23de | 140 | #define MICROBIT_BLE_DEVICE_INFORMATION_SERVICE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DEVICE_INFO_SERVICE |
LancasterUniversity | 27:2f494ead23de | 141 | #endif |
LancasterUniversity | 27:2f494ead23de | 142 | |
LancasterUniversity | 27:2f494ead23de | 143 | #endif |