Solution for Bluetooth SIG hands-on training course

Dependencies:   BLE_API mbed-dev-bin nRF51822-bluetooth-mdw

Dependents:   microbit

Fork of microbit-dal-bluetooth-mdw_starter by Martin Woolley

Committer:
LancasterUniversity
Date:
Wed Jul 13 12:18:42 2016 +0100
Revision:
63:b4372a29994f
Parent:
27:2f494ead23de
Child:
65:f7ebabf23e15
Synchronized with git rev 4cf48035
Author: Joe Finney
microbit: Added getDigitalValue overload for PullMode #156

- Introduced an overload to MicroBitIOPin::getDigitalValue() to permit the
setting of a specific pull mode at the time of reading.

- Bugfix of MicroBitIOPin::setPull() to persist preferred pull settings

- Added configuration options to allow the default PullMode to be set via
compile time option through MicroBitConfig.h or YOTTA_CONFIG

Who changed what in which revision?

UserRevisionLine numberNew 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 63:b4372a29994f 66 #ifdef YOTTA_CFG_MICROBIT_DAL_DEFAULT_PULLMODE
LancasterUniversity 63:b4372a29994f 67 #define MICROBIT_DEFAULT_PULLMODE YOTTA_CFG_MICROBIT_DAL_DEFAULT_PULLMODE
LancasterUniversity 63:b4372a29994f 68 #endif
LancasterUniversity 63:b4372a29994f 69
LancasterUniversity 27:2f494ead23de 70 #ifdef YOTTA_CFG_MICROBIT_DAL_PANIC_ON_HEAP_FULL
LancasterUniversity 27:2f494ead23de 71 #define MICROBIT_PANIC_HEAP_FULL YOTTA_CFG_MICROBIT_DAL_PANIC_ON_HEAP_FULL
LancasterUniversity 27:2f494ead23de 72 #endif
LancasterUniversity 27:2f494ead23de 73
LancasterUniversity 27:2f494ead23de 74 #ifdef YOTTA_CFG_MICROBIT_DAL_DEBUG
LancasterUniversity 27:2f494ead23de 75 #define MICROBIT_DBG YOTTA_CFG_MICROBIT_DAL_DEBUG
LancasterUniversity 27:2f494ead23de 76 #endif
LancasterUniversity 27:2f494ead23de 77
LancasterUniversity 27:2f494ead23de 78 #ifdef YOTTA_CFG_MICROBIT_DAL_HEAP_DEBUG
LancasterUniversity 27:2f494ead23de 79 #define MICROBIT_HEAP_DBG YOTTA_CFG_MICROBIT_DAL_HEAP_DEBUG
LancasterUniversity 27:2f494ead23de 80 #endif
LancasterUniversity 27:2f494ead23de 81
LancasterUniversity 27:2f494ead23de 82 #ifdef YOTTA_CFG_MICROBIT_DAL_STACK_SIZE
LancasterUniversity 27:2f494ead23de 83 #define MICROBIT_STACK_SIZE YOTTA_CFG_MICROBIT_DAL_STACK_SIZE
LancasterUniversity 27:2f494ead23de 84 #endif
LancasterUniversity 27:2f494ead23de 85
LancasterUniversity 27:2f494ead23de 86 #ifdef YOTTA_CFG_MICROBIT_DAL_SRAM_BASE
LancasterUniversity 27:2f494ead23de 87 #define MICROBIT_SRAM_BASE YOTTA_CFG_MICROBIT_DAL_SRAM_BASE
LancasterUniversity 27:2f494ead23de 88 #endif
LancasterUniversity 27:2f494ead23de 89
LancasterUniversity 27:2f494ead23de 90 #ifdef YOTTA_CFG_MICROBIT_DAL_SRAM_END
LancasterUniversity 27:2f494ead23de 91 #define MICROBIT_SRAM_END YOTTA_CFG_MICROBIT_DAL_SRAM_END
LancasterUniversity 27:2f494ead23de 92 #endif
LancasterUniversity 27:2f494ead23de 93
LancasterUniversity 27:2f494ead23de 94 #ifdef YOTTA_CFG_MICROBIT_DAL_SD_LIMIT
LancasterUniversity 27:2f494ead23de 95 #define MICROBIT_SD_LIMIT YOTTA_CFG_MICROBIT_DAL_SD_LIMIT
LancasterUniversity 27:2f494ead23de 96 #endif
LancasterUniversity 27:2f494ead23de 97
LancasterUniversity 27:2f494ead23de 98 #ifdef YOTTA_CFG_MICROBIT_DAL_GATT_TABLE_START
LancasterUniversity 27:2f494ead23de 99 #define MICROBIT_SD_GATT_TABLE_START YOTTA_CFG_MICROBIT_DAL_GATT_TABLE_START
LancasterUniversity 27:2f494ead23de 100 #endif
LancasterUniversity 27:2f494ead23de 101
LancasterUniversity 27:2f494ead23de 102
LancasterUniversity 27:2f494ead23de 103 //Bluetooth mappings
LancasterUniversity 27:2f494ead23de 104 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PAIRING_MODE
LancasterUniversity 27:2f494ead23de 105 #define MICROBIT_BLE_PAIRING_MODE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PAIRING_MODE
LancasterUniversity 27:2f494ead23de 106 #endif
LancasterUniversity 27:2f494ead23de 107
LancasterUniversity 27:2f494ead23de 108 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PRIVATE_ADDRESSING
LancasterUniversity 27:2f494ead23de 109 #define MICROBIT_BLE_PRIVATE_ADDRESSES YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PRIVATE_ADDRESSING
LancasterUniversity 27:2f494ead23de 110 #endif
LancasterUniversity 27:2f494ead23de 111
LancasterUniversity 27:2f494ead23de 112 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_OPEN
LancasterUniversity 27:2f494ead23de 113 #define MICROBIT_BLE_OPEN YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_OPEN
LancasterUniversity 27:2f494ead23de 114 #endif
LancasterUniversity 27:2f494ead23de 115
LancasterUniversity 27:2f494ead23de 116
LancasterUniversity 27:2f494ead23de 117 //we check if the user has requested open mode, otherwise we will double def!
LancasterUniversity 27:2f494ead23de 118 #if (YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_OPEN == 0)
LancasterUniversity 27:2f494ead23de 119
LancasterUniversity 27:2f494ead23de 120 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_WHITELIST
LancasterUniversity 27:2f494ead23de 121 #define MICROBIT_BLE_WHITELIST YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_WHITELIST
LancasterUniversity 27:2f494ead23de 122 #endif
LancasterUniversity 27:2f494ead23de 123
LancasterUniversity 27:2f494ead23de 124 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_ADVERTISING_TIMEOUT
LancasterUniversity 27:2f494ead23de 125 #define MICROBIT_BLE_ADVERTISING_TIMEOUT YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_ADVERTISING_TIMEOUT
LancasterUniversity 27:2f494ead23de 126 #endif
LancasterUniversity 27:2f494ead23de 127
LancasterUniversity 27:2f494ead23de 128 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_TX_POWER
LancasterUniversity 27:2f494ead23de 129 #define MICROBIT_BLE_DEFAULT_TX_POWER YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_TX_POWER
LancasterUniversity 27:2f494ead23de 130 #endif
LancasterUniversity 27:2f494ead23de 131
LancasterUniversity 27:2f494ead23de 132 #endif
LancasterUniversity 27:2f494ead23de 133
LancasterUniversity 27:2f494ead23de 134
LancasterUniversity 27:2f494ead23de 135 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DFU_SERVICE
LancasterUniversity 27:2f494ead23de 136 #define MICROBIT_BLE_DFU_SERVICE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DFU_SERVICE
LancasterUniversity 27:2f494ead23de 137 #endif
LancasterUniversity 27:2f494ead23de 138
LancasterUniversity 27:2f494ead23de 139 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_EVENT_SERVICE
LancasterUniversity 27:2f494ead23de 140 #define MICROBIT_BLE_EVENT_SERVICE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_EVENT_SERVICE
LancasterUniversity 27:2f494ead23de 141 #endif
LancasterUniversity 27:2f494ead23de 142
LancasterUniversity 27:2f494ead23de 143 #ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DEVICE_INFO_SERVICE
LancasterUniversity 27:2f494ead23de 144 #define MICROBIT_BLE_DEVICE_INFORMATION_SERVICE YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_DEVICE_INFO_SERVICE
LancasterUniversity 27:2f494ead23de 145 #endif
LancasterUniversity 27:2f494ead23de 146
LancasterUniversity 27:2f494ead23de 147 #endif