diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.cpp index 1274151d0d4..811e7152544 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.cpp @@ -24,7 +24,6 @@ #include "ble_conn_params.h" #include "btle_gap.h" -#include "btle_advertising.h" #include "custom/custom_helper.h" #include "ble/GapEvents.h" @@ -165,6 +164,10 @@ error_t btle_init(void) return ERROR_INVALID_PARAM; } + // Peer Manger must been initialised prior any other call to its API (this file and btle_security_pm.cpp) + pm_init(); + +#if (NRF_SD_BLE_API_VERSION <= 2) ble_gap_addr_t addr; if (sd_ble_gap_address_get(&addr) != NRF_SUCCESS) { return ERROR_INVALID_PARAM; @@ -172,6 +175,11 @@ error_t btle_init(void) if (sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &addr) != NRF_SUCCESS) { return ERROR_INVALID_PARAM; } +#else + ble_gap_privacy_params_t privacy_params = {0}; + privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_OFF; + pm_privacy_set(&privacy_params); +#endif ASSERT_STATUS( softdevice_ble_evt_handler_set(btle_handler)); ASSERT_STATUS( softdevice_sys_evt_handler_set(sys_evt_dispatch)); @@ -219,12 +227,25 @@ static void btle_handler(ble_evt_t *p_ble_evt) gap.setConnectionHandle(handle); const Gap::ConnectionParams_t *params = reinterpret_cast(&(p_ble_evt->evt.gap_evt.params.connected.conn_params)); const ble_gap_addr_t *peer = &p_ble_evt->evt.gap_evt.params.connected.peer_addr; +#if (NRF_SD_BLE_API_VERSION <= 2) const ble_gap_addr_t *own = &p_ble_evt->evt.gap_evt.params.connected.own_addr; + gap.processConnectionEvent(handle, - role, - static_cast(peer->addr_type), peer->addr, - static_cast(own->addr_type), own->addr, - params); + role, + static_cast(peer->addr_type), peer->addr, + static_cast(own->addr_type), own->addr, + params); +#else + Gap::AddressType_t addr_type; + Gap::Address_t own_address; + gap.getAddress(&addr_type, own_address); + + gap.processConnectionEvent(handle, + role, + static_cast(peer->addr_type), peer->addr, + addr_type, own_address, + params); +#endif break; } diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.h index 2e6fe3d9f7d..021dd50513b 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.h @@ -24,7 +24,7 @@ extern "C" { #include "common/common.h" #include "ble_srv_common.h" -#include "nrf_ble.h" +#include "headers/nrf_ble.h" error_t btle_init(void); diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_advertising.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_advertising.cpp deleted file mode 100644 index cdaf6a4a49c..00000000000 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_advertising.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "common/common.h" - -#include "ble_advdata.h" -#include "btle.h" - -/**************************************************************************/ -/*! - @brief Starts the advertising process - - @returns -*/ -/**************************************************************************/ -error_t btle_advertising_start(void) -{ - ble_gap_adv_params_t adv_para = {0}; - - /* Set the default advertising parameters */ - adv_para.type = BLE_GAP_ADV_TYPE_ADV_IND; - adv_para.p_peer_addr = NULL; /* Undirected advertising */ - adv_para.fp = BLE_GAP_ADV_FP_ANY; - adv_para.p_whitelist = NULL; - adv_para.interval = (CFG_GAP_ADV_INTERVAL_MS * 8) / 5; /* Advertising - * interval in - * units of 0.625 - * ms */ - adv_para.timeout = CFG_GAP_ADV_TIMEOUT_S; - - ASSERT_STATUS( sd_ble_gap_adv_start(&adv_para)); - - return ERROR_NONE; -} diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_advertising.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_advertising.h deleted file mode 100644 index a215153ab5e..00000000000 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_advertising.h +++ /dev/null @@ -1,24 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _BTLE_ADVERTISING_H_ -#define _BTLE_ADVERTISING_H_ - -#include "common/common.h" - -error_t btle_advertising_start(void); - -#endif // ifndef _BTLE_ADVERTISING_H_ diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_discovery.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_discovery.cpp index 0b6b1d6a9cc..99059f6623a 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_discovery.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_discovery.cpp @@ -57,7 +57,7 @@ void bleGattcEventHandler(const ble_evt_t *p_ble_evt) case BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP: if (sdSingleton.isActive()) { - sdSingleton.processDiscoverUUIDResponse(&p_ble_evt->evt.gattc_evt.params.char_val_by_uuid_read_rsp); + sdSingleton.processDiscoverUUIDResponse(&p_ble_evt->evt.gattc_evt); } break; diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_gap.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_gap.cpp index 5dbc372135f..8bc8600d7b1 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_gap.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_gap.cpp @@ -15,7 +15,7 @@ */ #include "common/common.h" -#include "nrf_ble_gap.h" +#include "headers/nrf_ble_gap.h" #include "ble_conn_params.h" static inline uint32_t msec_to_1_25msec(uint32_t interval_ms) ATTR_ALWAYS_INLINE ATTR_CONST; diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security.h index 4f863975ab3..3197e838818 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security.h @@ -84,6 +84,7 @@ ble_error_t btle_setLinkSecurity(Gap::Handle_t connectionHandle, SecurityManager */ ble_error_t btle_purgeAllBondingState(void); +#if (NRF_SD_BLE_API_VERSION <= 2) /** * Query the SoftDevice bond table to extract a whitelist containing the BLE * addresses and IRKs of bonded devices. @@ -98,6 +99,7 @@ ble_error_t btle_purgeAllBondingState(void); * @return BLE_ERROR_NONE Or appropriate error code indicating reason for failure. */ ble_error_t btle_createWhitelistFromBondTable(ble_gap_whitelist_t *p_whitelist); +#endif /** * Function to test whether a BLE address is generated using an IRK. diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security_pm.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security_pm.cpp index e29002d07ab..8b0c16175e1 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security_pm.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle_security_pm.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#if defined(S130) || defined(S132) +#if defined(S130) || defined(S132) || defined(S140) #include "btle.h" #include "nRF5xn.h" @@ -94,10 +94,6 @@ btle_initializeSecurity(bool enableBonding, } } - if (pm_init() != NRF_SUCCESS) { - return BLE_ERROR_UNSPECIFIED; - } - // update default security parameters with function call parameters securityParameters.bond = enableBonding; securityParameters.mitm = requireMITM; @@ -393,6 +389,7 @@ void pm_handler(pm_evt_t const *p_event) } } +#if (NRF_SD_BLE_API_VERSION <= 2) ble_error_t btle_createWhitelistFromBondTable(ble_gap_whitelist_t *p_whitelist) { @@ -408,7 +405,7 @@ btle_createWhitelistFromBondTable(ble_gap_whitelist_t *p_whitelist) return BLE_ERROR_INVALID_STATE; } } - +#endif bool btle_matchAddressAndIrk(ble_gap_addr_t const * p_addr, ble_gap_irk_t const * p_irk) diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/custom/custom_helper.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/custom/custom_helper.h index 22a32907c1b..af47fb98527 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/custom/custom_helper.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/custom/custom_helper.h @@ -18,7 +18,7 @@ #define _CUSTOM_HELPER_H_ #include "common/common.h" -#include "nrf_ble.h" +#include "headers/nrf_ble.h" #include "ble/UUID.h" #include "ble/GattCharacteristic.h" diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.cpp index a06de22ffd1..0dee44efbfc 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ #include "nRF5xCharacteristicDescriptorDiscoverer.h" -#include "nrf_ble_err.h" +#include "headers/nrf_ble_err.h" #include "ble/DiscoveredCharacteristicDescriptor.h" nRF5xCharacteristicDescriptorDiscoverer::nRF5xCharacteristicDescriptorDiscoverer() : @@ -136,6 +136,7 @@ void nRF5xCharacteristicDescriptorDiscoverer::processAttributeInformation( return; } +#if (NRF_SD_BLE_API_VERSION <= 2) // for all UUIDS found, process the discovery for (uint16_t i = 0; i < infos.count; ++i) { bool use_16bits_uuids = infos.format == BLE_GATTC_ATTR_INFO_FORMAT_16BIT; @@ -146,6 +147,27 @@ void nRF5xCharacteristicDescriptorDiscoverer::processAttributeInformation( // prepare the next round of descriptors discovery uint16_t startHandle = infos.attr_info[infos.count - 1].handle + 1; +#else + uint16_t startHandle; + // for all UUIDS found, process the discovery + if (infos.format == BLE_GATTC_ATTR_INFO_FORMAT_16BIT) { + for (uint16_t i = 0; i < infos.count; ++i) { + UUID uuid = UUID(infos.info.attr_info16[i].uuid.uuid); + discovery->process(infos.info.attr_info16[i].handle, uuid); + } + + // prepare the next round of descriptors discovery + startHandle = infos.info.attr_info16[infos.count - 1].handle + 1; + } else { + for (uint16_t i = 0; i < infos.count; ++i) { + UUID uuid = UUID(infos.info.attr_info128[i].uuid.uuid128, UUID::LSB); + discovery->process(infos.info.attr_info128[i].handle, uuid); + } + + // prepare the next round of descriptors discovery + startHandle = infos.info.attr_info128[infos.count - 1].handle + 1; + } +#endif uint16_t endHandle = discovery->getCharacteristic().getLastHandle(); if(startHandle > endHandle) { diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.h index 285a4a12885..753e368f0fe 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xCharacteristicDescriptorDiscoverer.h @@ -21,7 +21,7 @@ #include "ble/DiscoveredCharacteristic.h" #include "ble/CharacteristicDescriptorDiscovery.h" #include "ble/GattClient.h" -#include "nrf_ble_gattc.h" +#include "headers/nrf_ble_gattc.h" /** * @brief Manage the discovery of Characteristic descriptors diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.cpp index a228a624d2b..f7d6996f4d8 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.cpp @@ -16,7 +16,7 @@ #include "nRF5xDiscoveredCharacteristic.h" #include "nRF5xGattClient.h" -#include "nrf_ble_gatt.h" +#include "headers/nrf_ble_gatt.h" void nRF5xDiscoveredCharacteristic::setup(nRF5xGattClient *gattcIn, diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.h index 7b4bfc82c7c..87ebbbf7679 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xDiscoveredCharacteristic.h @@ -18,7 +18,7 @@ #define __NRF_DISCOVERED_CHARACTERISTIC_H__ #include "ble/DiscoveredCharacteristic.h" -#include "nrf_ble_gatt.h" +#include "headers/nrf_ble_gatt.h" class nRF5xGattClient; /* forward declaration */ diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.cpp index f874bfefe52..56c9218feeb 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.cpp @@ -24,7 +24,13 @@ #include "common/common.h" #include "ble_advdata.h" -#include "nrf_ble_hci.h" +#include "headers/nrf_ble_hci.h" + +#if (NRF_SD_BLE_API_VERSION >= 3) + #include "peer_manager.h" + #include "peer_data_storage.h" +#endif + void radioNotificationStaticCallback(bool param) { nRF5xGap &gap = (nRF5xGap &) nRF5xn::Instance(BLE::DEFAULT_INSTANCE).getGap(); @@ -135,6 +141,9 @@ ble_error_t nRF5xGap::setAdvertisingData(const GapAdvertisingData &advData, cons /**************************************************************************/ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms) { + uint32_t err; + ble_gap_adv_params_t adv_para = {0}; + /* Make sure we support the advertising type */ if (params.getAdvertisingType() == GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED) { /* ToDo: This requires a propery security implementation, etc. */ @@ -168,6 +177,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms) return BLE_ERROR_PARAM_OUT_OF_RANGE; } +#if (NRF_SD_BLE_API_VERSION <= 2) /* Allocate the stack's whitelist statically */ ble_gap_whitelist_t whitelist; ble_gap_addr_t *whitelistAddressPtrs[YOTTA_CFG_WHITELIST_MAX_SIZE]; @@ -185,18 +195,22 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms) return error; } } - + + adv_para.p_whitelist = &whitelist; +#endif + /* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */ + /* Start Advertising */ - ble_gap_adv_params_t adv_para = {0}; + adv_para.type = params.getAdvertisingType(); adv_para.p_peer_addr = NULL; // Undirected advertisement adv_para.fp = advertisingPolicyMode; - adv_para.p_whitelist = &whitelist; adv_para.interval = params.getIntervalInADVUnits(); // advertising interval (in units of 0.625 ms) adv_para.timeout = params.getTimeout(); + - uint32_t err = sd_ble_gap_adv_start(&adv_para); + err = sd_ble_gap_adv_start(&adv_para); switch(err) { case ERROR_NONE: return BLE_ERROR_NONE; @@ -211,6 +225,10 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms) #if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110) ble_error_t nRF5xGap::startRadioScan(const GapScanningParams &scanningParams) { + + ble_gap_scan_params_t scanParams; + +#if (NRF_SD_BLE_API_VERSION <= 2) /* Allocate the stack's whitelist statically */ ble_gap_whitelist_t whitelist; ble_gap_addr_t *whitelistAddressPtrs[YOTTA_CFG_WHITELIST_MAX_SIZE]; @@ -229,11 +247,17 @@ ble_error_t nRF5xGap::startRadioScan(const GapScanningParams &scanningParams) } } - ble_gap_scan_params_t scanParams; - - scanParams.active = scanningParams.getActiveScanning(); /**< If 1, perform active scanning (scan requests). */ scanParams.selective = scanningPolicyMode; /**< If 1, ignore unknown devices (non whitelisted). */ scanParams.p_whitelist = &whitelist; /**< Pointer to whitelist, NULL if none is given. */ +#else + /* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */ + + scanParams.use_whitelist = scanningPolicyMode; + scanParams.adv_dir_report = 0; +#endif + + scanParams.active = scanningParams.getActiveScanning(); /**< If 1, perform active scanning (scan requests). */ + scanParams.interval = scanningParams.getInterval(); /**< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */ scanParams.window = scanningParams.getWindow(); /**< Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */ scanParams.timeout = scanningParams.getTimeout(); /**< Scan timeout between 0x0001 and 0xFFFF in seconds, 0x0000 disables timeout. */ @@ -302,6 +326,9 @@ ble_error_t nRF5xGap::connect(const Address_t peerAddr, connParams.conn_sup_timeout = 600; } + ble_gap_scan_params_t scanParams ={0}; + +#if (NRF_SD_BLE_API_VERSION <= 2) /* Allocate the stack's whitelist statically */ ble_gap_whitelist_t whitelist; ble_gap_addr_t *whitelistAddressPtrs[YOTTA_CFG_WHITELIST_MAX_SIZE]; @@ -319,10 +346,28 @@ ble_error_t nRF5xGap::connect(const Address_t peerAddr, return error; } } - - ble_gap_scan_params_t scanParams; + scanParams.selective = scanningPolicyMode; /**< If 1, ignore unknown devices (non whitelisted). */ scanParams.p_whitelist = &whitelist; /**< Pointer to whitelist, NULL if none is given. */ +#else + /* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */ + + scanParams.use_whitelist = (whitelistAddressesSize) ? 1 : 0; + + if ((addr.addr_type == BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE) + || (addr.addr_type == BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE)) { + /* If a device is using Resolvable Private Addresses Section 1.3.2.2 (Core spec v4.2 volume 6 part B), + it shall also have an Identity Address that is either a Public or Random Static address type.” + To establish a connection, a static address must be provided by the application to the SoftDevice. + The SoftDevice resolves the address and connects to the right device if it is available. */ + addr.addr_id_peer = 1; + addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC; + } else { + addr.addr_id_peer = 0; + } + +#endif + if (scanParamsIn != NULL) { scanParams.active = scanParamsIn->getActiveScanning(); /**< If 1, perform active scanning (scan requests). */ scanParams.interval = scanParamsIn->getInterval(); /**< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */ @@ -447,6 +492,7 @@ ble_error_t nRF5xGap::reset(void) /* Clear the internal whitelist */ whitelistAddressesSize = 0; + return BLE_ERROR_NONE; } @@ -489,7 +535,13 @@ uint16_t nRF5xGap::getConnectionHandle(void) /**************************************************************************/ ble_error_t nRF5xGap::setAddress(AddressType_t type, const Address_t address) { +#if (NRF_SD_BLE_API_VERSION <= 2) uint8_t cycle_mode; +#else + ble_gap_privacy_params_t privacy_params = {0}; +#endif + + ble_gap_addr_t dev_addr; /* When using Public or Static addresses, the cycle mode must be None. @@ -498,12 +550,27 @@ ble_error_t nRF5xGap::setAddress(AddressType_t type, const Address_t address) */ if ((type == BLEProtocol::AddressType::PUBLIC) || (type == BLEProtocol::AddressType::RANDOM_STATIC)) { + memcpy(dev_addr.addr, address, ADDR_LEN); +#if (NRF_SD_BLE_API_VERSION <= 2) cycle_mode = BLE_GAP_ADDR_CYCLE_MODE_NONE; - memcpy(dev_addr.addr, address, ADDR_LEN); +#else + privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_OFF; + dev_addr.addr_type = type; + + ASSERT_INT(ERROR_NONE, pm_id_addr_set(&dev_addr), BLE_ERROR_PARAM_OUT_OF_RANGE); + ASSERT_INT(ERROR_NONE, pm_privacy_set(&privacy_params), BLE_ERROR_PARAM_OUT_OF_RANGE); +#endif } else if ((type == BLEProtocol::AddressType::RANDOM_PRIVATE_RESOLVABLE) || (type == BLEProtocol::AddressType::RANDOM_PRIVATE_NON_RESOLVABLE)) { +#if (NRF_SD_BLE_API_VERSION <= 2) cycle_mode = BLE_GAP_ADDR_CYCLE_MODE_AUTO; +#else + privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY; + privacy_params.private_addr_type = type; + + ASSERT_INT(ERROR_NONE, pm_privacy_set(&privacy_params), BLE_ERROR_PARAM_OUT_OF_RANGE); +#endif // address is ignored when in auto mode } else @@ -511,8 +578,10 @@ ble_error_t nRF5xGap::setAddress(AddressType_t type, const Address_t address) return BLE_ERROR_PARAM_OUT_OF_RANGE; } +#if (NRF_SD_BLE_API_VERSION <= 2) dev_addr.addr_type = type; ASSERT_INT(ERROR_NONE, sd_ble_gap_address_set(cycle_mode, &dev_addr), BLE_ERROR_PARAM_OUT_OF_RANGE); +#endif return BLE_ERROR_NONE; } @@ -520,7 +589,11 @@ ble_error_t nRF5xGap::setAddress(AddressType_t type, const Address_t address) ble_error_t nRF5xGap::getAddress(AddressType_t *typeP, Address_t address) { ble_gap_addr_t dev_addr; +#if (NRF_SD_BLE_API_VERSION <= 2) if (sd_ble_gap_address_get(&dev_addr) != NRF_SUCCESS) { +#else + if (sd_ble_gap_addr_get(&dev_addr) != NRF_SUCCESS) { +#endif return BLE_ERROR_PARAM_OUT_OF_RANGE; } @@ -599,6 +672,10 @@ void nRF5xGap::getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *co static const int8_t permittedTxValues[] = { -40, -20, -16, -12, -8, -4, 0, 4 }; +#elif defined(NRF52840_XXAA) + static const int8_t permittedTxValues[] = { + -40, -20, -16, -12, -8, -4, 0, 2, 3, 4, 5, 6, 7, 8, 9 + }; #else #error permitted TX power values unknown for this SOC #endif @@ -648,9 +725,12 @@ uint8_t nRF5xGap::getMaxWhitelistSize(void) const /**************************************************************************/ ble_error_t nRF5xGap::getWhitelist(Gap::Whitelist_t &whitelistOut) const { - uint8_t i; + uint32_t i; for (i = 0; i < whitelistAddressesSize && i < whitelistOut.capacity; ++i) { - memcpy(&whitelistOut.addresses[i], &whitelistAddresses[i], sizeof(BLEProtocol::Address_t)); + memcpy( &whitelistOut.addresses[i].address, &whitelistAddresses[i].addr, sizeof(whitelistOut.addresses[0].address)); + whitelistOut.addresses[i].type = static_cast (whitelistAddresses[i].addr_type); + + } whitelistOut.size = i; @@ -694,19 +774,24 @@ ble_error_t nRF5xGap::setWhitelist(const Gap::Whitelist_t &whitelistIn) } /* Test for invalid parameters before we change the internal state */ - for (uint8_t i = 0; i < whitelistIn.size; ++i) { + for (uint32_t i = 0; i < whitelistIn.size; ++i) { if (whitelistIn.addresses[i].type == BLEProtocol::AddressType::RANDOM_PRIVATE_NON_RESOLVABLE) { /* This is not allowed because it is completely meaningless */ return BLE_ERROR_INVALID_PARAM; } } - whitelistAddressesSize = 0; - for (uint8_t i = 0; i < whitelistIn.size; ++i) { - memcpy(&whitelistAddresses[whitelistAddressesSize], &whitelistIn.addresses[i], sizeof(BLEProtocol::Address_t)); - whitelistAddressesSize++; + whitelistAddressesSize = whitelistIn.size; + + for (uint32_t i = 0; i < whitelistIn.size; ++i) { + memcpy(&whitelistAddresses[i].addr , &whitelistIn.addresses[i].address , sizeof(whitelistAddresses[0].addr)); + whitelistAddresses[i].addr_type = static_cast (whitelistIn.addresses[i].type); } +#if (NRF_SD_BLE_API_VERSION >= 3) + updateWhiteAndIdentityListInStack(); +#endif + return BLE_ERROR_NONE; } @@ -846,6 +931,7 @@ Gap::InitiatorPolicyMode_t nRF5xGap::getInitiatorPolicyMode(void) const return Gap::INIT_POLICY_IGNORE_WHITELIST; } +#if (NRF_SD_BLE_API_VERSION <= 2) /**************************************************************************/ /*! @brief Helper function used to populate the ble_gap_whitelist_t that @@ -945,3 +1031,167 @@ ble_error_t nRF5xGap::generateStackWhitelist(ble_gap_whitelist_t &whitelist) return BLE_ERROR_NONE; } +#endif + +#if (NRF_SD_BLE_API_VERSION >= 3) + +/** + * Function for preparing settings of the whitelist feature and the identity-resolving feature (privacy) for the SoftDevice. + * + * Gap::setWhitelist provides the base for preparation of these settings. + * This function matches resolvable addresses (passed by Gap::setWhitelist) to IRK data in bonds table. + * Therefore resolvable addresses instead of being passed to the whitelist (intended to be passed to the Softdevice) + * are passed to the identities list (intended to be passed to the Softdevice). + * + * @param[out] gapAdrHelper Reference to the struct for storing settings. + */ + +ble_error_t nRF5xGap::getStackWhiteIdentityList(GapWhiteAndIdentityList_t &gapAdrHelper) +{ + pm_peer_id_t peer_id; + + ret_code_t ret; + + pm_peer_data_bonding_t bond_data; + + uint8_t irk_found[YOTTA_CFG_WHITELIST_MAX_SIZE]; + + memset(irk_found, 0x00, sizeof(irk_found)); + + + gapAdrHelper.identities_cnt = 0; + + + peer_id = pm_next_peer_id_get(PM_PEER_ID_INVALID); + + nRF5xSecurityManager& securityManager = (nRF5xSecurityManager&) nRF5xn::Instance(0).getSecurityManager(); + + /** + * Build identities list: + * For every private resolvable address in the bond table check if + * there is maching address in th provided whitelist. + */ + while (peer_id != PM_PEER_ID_INVALID) + { + memset(&bond_data, 0x00, sizeof(bond_data)); + + // Read peer data from flash. + ret = pm_peer_data_bonding_load(peer_id, &bond_data); + + + if ((ret == NRF_ERROR_NOT_FOUND) || (ret == NRF_ERROR_INVALID_PARAM)) + { + // Peer data could not be found in flash or peer ID is not valid. + return BLE_ERROR_UNSPECIFIED; + } + + if ( bond_data.peer_ble_id.id_addr_info.addr_type == BLEProtocol::AddressType::RANDOM_PRIVATE_RESOLVABLE) + { + for (uint8_t i = 0; i < whitelistAddressesSize; ++i) + { + if (!irk_found[i]) + { + if (whitelistAddresses[i].addr_type == BLEProtocol::AddressType::RANDOM_PRIVATE_RESOLVABLE) + { + + //ble_gap_irk_t *p_dfg = &bond_data.peer_ble_id.id_info; + if (securityManager.matchAddressAndIrk(&whitelistAddresses[i], &bond_data.peer_ble_id.id_info)) + { + // Copy data to the buffer. + memcpy(&gapAdrHelper.identities[i], &bond_data.peer_ble_id, sizeof(ble_gap_id_key_t)); + gapAdrHelper.identities_cnt++; + + irk_found[i] = 1; // don't look at this address again + } + } + } + } + } + + // get next peer id + peer_id = pm_next_peer_id_get(peer_id); + } + + gapAdrHelper.addrs_cnt = 0; + + /** + * Build whitelist from the rest of addresses (explicit addresses) + */ + for (uint8_t i = 0; i < whitelistAddressesSize; ++i) + { + if (!irk_found[i]) + { + memcpy(&gapAdrHelper.addrs[i], &whitelistAddresses[i], sizeof(ble_gap_addr_t)); + gapAdrHelper.addrs[i].addr_id_peer = 0; + gapAdrHelper.addrs_cnt++; + } + } + + return BLE_ERROR_NONE; +} + +ble_error_t nRF5xGap::applyWhiteIdentityList(GapWhiteAndIdentityList_t &gapAdrHelper) +{ + uint32_t retc; + + if (gapAdrHelper.identities_cnt == 0) { + retc = sd_ble_gap_device_identities_set(NULL, NULL, 0); + } else { + ble_gap_id_key_t * pp_identities[YOTTA_CFG_IRK_TABLE_MAX_SIZE]; + + for (uint32_t i = 0; i < gapAdrHelper.identities_cnt; ++i) + { + pp_identities[i] = &gapAdrHelper.identities[i]; + } + + retc = sd_ble_gap_device_identities_set(pp_identities, NULL /* Don't use local IRKs*/,gapAdrHelper.identities_cnt); + } + + if (retc == NRF_SUCCESS) { + if (gapAdrHelper.addrs_cnt == 0) { + retc = sd_ble_gap_whitelist_set(NULL, 0); + } else { + ble_gap_addr_t * pp_addrs[YOTTA_CFG_IRK_TABLE_MAX_SIZE]; + + for (uint32_t i = 0; i < gapAdrHelper.addrs_cnt; ++i) + { + pp_addrs[i] = &gapAdrHelper.addrs[i]; + } + + retc = sd_ble_gap_whitelist_set(pp_addrs, gapAdrHelper.addrs_cnt); + } + } + + switch(retc) { + case NRF_SUCCESS: + return BLE_ERROR_NONE; + + case BLE_ERROR_GAP_WHITELIST_IN_USE: //The whitelist is in use by a BLE role and cannot be set or cleared. + case BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE: //The device identity list is in use and cannot be set or cleared. + return BLE_ERROR_ALREADY_INITIALIZED; + + case NRF_ERROR_INVALID_ADDR: + case BLE_ERROR_GAP_INVALID_BLE_ADDR: //Invalid address type is supplied. + case NRF_ERROR_DATA_SIZE: + case BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE: //The device identity list contains multiple entries with the same identity address. + return BLE_ERROR_INVALID_PARAM; + + default: + return BLE_ERROR_UNSPECIFIED; + } +} + +ble_error_t nRF5xGap::updateWhiteAndIdentityListInStack() +{ + GapWhiteAndIdentityList_t whiteAndIdentityList; + uint32_t err; + + err = getStackWhiteIdentityList(whiteAndIdentityList); + + if (err != BLE_ERROR_NONE) { + return (ble_error_t)err; + } + + return applyWhiteIdentityList(whiteAndIdentityList); +} +#endif diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.h index cdcd9fa8fea..922260954a5 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.h @@ -29,13 +29,17 @@ #define YOTTA_CFG_WHITELIST_MAX_SIZE BLE_GAP_WHITELIST_ADDR_MAX_COUNT #endif #ifndef YOTTA_CFG_IRK_TABLE_MAX_SIZE - #define YOTTA_CFG_IRK_TABLE_MAX_SIZE BLE_GAP_WHITELIST_IRK_MAX_COUNT + #if (NRF_SD_BLE_API_VERSION >= 3) + #define YOTTA_CFG_IRK_TABLE_MAX_SIZE BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT + #else + #define YOTTA_CFG_IRK_TABLE_MAX_SIZE BLE_GAP_WHITELIST_IRK_MAX_COUNT + #endif #elif YOTTA_CFG_IRK_TABLE_MAX_SIZE > BLE_GAP_WHITELIST_IRK_MAX_COUNT #undef YOTTA_CFG_IRK_TABLE_MAX_SIZE #define YOTTA_CFG_IRK_TABLE_MAX_SIZE BLE_GAP_WHITELIST_IRK_MAX_COUNT #endif #include "ble/blecommon.h" -#include "nrf_ble.h" +#include "headers/nrf_ble.h" #include "ble/GapAdvertisingParams.h" #include "ble/GapAdvertisingData.h" #include "ble/Gap.h" @@ -135,6 +139,7 @@ class nRF5xGap : public Gap uint8_t whitelistAddressesSize; ble_gap_addr_t whitelistAddresses[YOTTA_CFG_WHITELIST_MAX_SIZE]; +#if (NRF_SD_BLE_API_VERSION <= 2) /* * An internal function used to populate the ble_gap_whitelist_t that will be used by * the SoftDevice for filtering requests. This function is needed because for the BLE @@ -142,6 +147,30 @@ class nRF5xGap : public Gap * the IRK table. */ ble_error_t generateStackWhitelist(ble_gap_whitelist_t &whitelist); +#endif + +#if (NRF_SD_BLE_API_VERSION >= 3) + /* internal type for passing a whitelist and a identities list. */ + typedef struct + { + ble_gap_addr_t addrs[YOTTA_CFG_WHITELIST_MAX_SIZE]; + uint32_t addrs_cnt; + + ble_gap_id_key_t identities[YOTTA_CFG_IRK_TABLE_MAX_SIZE]; + uint32_t identities_cnt; + } GapWhiteAndIdentityList_t; + + /* Function for preparing setting of the whitelist feature and the identity-resolving feature (privacy).*/ + ble_error_t getStackWhiteIdentityList(GapWhiteAndIdentityList_t &whiteAndIdentityList); + + /* Function for applying setting of the whitelist feature and identity-resolving feature (privacy).*/ + ble_error_t applyWhiteIdentityList(GapWhiteAndIdentityList_t &whiteAndIdentityList); + + /* Function for introducing whitelist feature and the identity-resolving feature setting into SoftDevice. + * + * This function incorporates getStackWhiteIdentityList and applyWhiteIdentityList together. */ + ble_error_t updateWhiteAndIdentityListInStack(void); +#endif private: bool radioNotificationCallbackParam; /* parameter to be passed into the Timeout-generated radio notification callback. */ diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGattServer.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGattServer.h index dc40f8b3619..77bfd26d908 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGattServer.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGattServer.h @@ -20,7 +20,7 @@ #include #include "ble/blecommon.h" -#include "nrf_ble.h" /* nordic ble */ +#include "headers/nrf_ble.h" /* nordic ble */ #include "ble/Gap.h" #include "ble/GattServer.h" diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xSecurityManager.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xSecurityManager.h index 2fa7b05511e..1b675806d93 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xSecurityManager.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xSecurityManager.h @@ -45,7 +45,7 @@ class nRF5xSecurityManager : public SecurityManager virtual ble_error_t purgeAllBondingState(void) { return btle_purgeAllBondingState(); } - +#if (NRF_SD_BLE_API_VERSION <= 2) /** * @brief Returns a list of addresses from peers in the stacks bond table. * @@ -57,6 +57,8 @@ class nRF5xSecurityManager : public SecurityManager * * @return * BLE_ERROR_NONE if successful. + * + * @todo check whether remove this function (because it is never called) */ virtual ble_error_t getAddressesFromBondTable(Gap::Whitelist_t &addresses) const { uint8_t i; @@ -112,7 +114,7 @@ class nRF5xSecurityManager : public SecurityManager return BLE_ERROR_NONE; } - +#endif /** * @brief Clear nRF5xSecurityManager's state. * @@ -146,6 +148,7 @@ class nRF5xSecurityManager : public SecurityManager nRF5xSecurityManager(const nRF5xSecurityManager &); const nRF5xSecurityManager& operator=(const nRF5xSecurityManager &); +#if (NRF_SD_BLE_API_VERSION <= 2) /* * Expose an interface that allows us to query the SoftDevice bond table * and extract a whitelist. @@ -153,7 +156,7 @@ class nRF5xSecurityManager : public SecurityManager ble_error_t createWhitelistFromBondTable(ble_gap_whitelist_t &whitelistFromBondTable) const { return btle_createWhitelistFromBondTable(&whitelistFromBondTable); } - +#endif /* * Given a BLE address and a IRK this function check whether the address * can be generated from the IRK. To do so, this function uses the hash diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.cpp index 4bd0da6dd7b..87ac20c8ff0 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.cpp @@ -281,12 +281,22 @@ nRF5xServiceDiscovery::CharUUIDDiscoveryQueue::triggerFirst(void) } void -nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_by_uuid_read_rsp_t *response) +nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_t *p_gattc_evt) { + const ble_gattc_evt_char_val_by_uuid_read_rsp_t * response = &p_gattc_evt->params.char_val_by_uuid_read_rsp; + if (state == DISCOVER_SERVICE_UUIDS) { if ((response->count == 1) && (response->value_len == UUID::LENGTH_OF_LONG_UUID)) { UUID::LongUUIDBytes_t uuid; - memcpy(uuid, response->handle_value[0].p_value, UUID::LENGTH_OF_LONG_UUID); + +#if (NRF_SD_BLE_API_VERSION >= 3) + ble_gattc_handle_value_t iter; + memset(&iter, 0, sizeof(ble_gattc_handle_value_t)); + (void) sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(const_cast(p_gattc_evt), &iter); + memcpy(uuid, iter.p_value, UUID::LENGTH_OF_LONG_UUID); +#else + memcpy(uuid, &(response->handle_value[0].p_value[0]), UUID::LENGTH_OF_LONG_UUID); +#endif unsigned serviceIndex = serviceUUIDDiscoveryQueue.dequeue(); services[serviceIndex].setupLongUUID(uuid, UUID::LSB); @@ -298,9 +308,16 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_char_val_ } else if (state == DISCOVER_CHARACTERISTIC_UUIDS) { if ((response->count == 1) && (response->value_len == UUID::LENGTH_OF_LONG_UUID + 1 /* props */ + 2 /* value handle */)) { UUID::LongUUIDBytes_t uuid; - + +#if (NRF_SD_BLE_API_VERSION >= 3) + ble_gattc_handle_value_t iter; + memset(&iter, 0, sizeof(ble_gattc_handle_value_t)); + (void) sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(const_cast(p_gattc_evt), &iter); + memcpy(uuid, &(iter.p_value[3]), UUID::LENGTH_OF_LONG_UUID); +#else memcpy(uuid, &(response->handle_value[0].p_value[3]), UUID::LENGTH_OF_LONG_UUID); - +#endif + unsigned charIndex = charUUIDDiscoveryQueue.dequeue(); characteristics[charIndex].setupLongUUID(uuid, UUID::LSB); diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.h index 20bf505936e..9fb28f1d798 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.h @@ -21,8 +21,8 @@ #include "ble/DiscoveredService.h" #include "nRF5xDiscoveredCharacteristic.h" -#include "nrf_ble.h" -#include "nrf_ble_gattc.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gattc.h" class nRF5xGattClient; /* forward declaration */ @@ -139,7 +139,7 @@ class nRF5xServiceDiscovery : public ServiceDiscovery void setupDiscoveredCharacteristics(const ble_gattc_evt_char_disc_rsp_t *response); void triggerServiceUUIDDiscovery(void); - void processDiscoverUUIDResponse(const ble_gattc_evt_char_val_by_uuid_read_rsp_t *response); + void processDiscoverUUIDResponse(const ble_gattc_evt_t *p_gattc_evt); void removeFirstServiceNeedingUUIDDiscovery(void); void terminateServiceDiscovery(void) { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/sdk_patch/sdk_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/sdk_patch/sdk_config.h new file mode 100644 index 00000000000..8ee54778fcc --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/sdk_patch/sdk_config.h @@ -0,0 +1,19 @@ +#ifndef _SDK_CONFIG_H_ +#define _SDK_CONFIG_H_ + +#include "nrf_drv_config.h" + +#define UART_DEFAULT_CONFIG_BAUDRATE UART0_CONFIG_BAUDRATE +#define UART_DEFAULT_CONFIG_PARITY UART0_CONFIG_PARITY +#define UART_DEFAULT_CONFIG_HWFC UART0_CONFIG_HWFC +#define CTS_PIN_NUMBER UART0_CONFIG_PSEL_CTS +#define RTS_PIN_NUMBER UART0_CONFIG_PSEL_RTS + +#define SPIS_DEFAULT_ORC NRF_DRV_SPIS_DEFAULT_ORC +#define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY SPIS1_CONFIG_IRQ_PRIORITY; +#define SPIS_DEFAULT_ORC NRF_DRV_SPIS_DEFAULT_ORC +#define SPIS_DEFAULT_DEF NRF_DRV_SPIS_DEFAULT_DEF + +#define SPI_DEFAULT_CONFIG_IRQ_PRIORITY SPI1_CONFIG_IRQ_PRIORITY + +#endif \ No newline at end of file diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/analogin_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/analogin_api.c deleted file mode 100644 index d33effecdf2..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/analogin_api.c +++ /dev/null @@ -1,91 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "mbed_assert.h" -#include "analogin_api.h" -#include "cmsis.h" -#include "pinmap.h" -#include "app_util_platform.h" -#include "nrf_drv_saadc.h" - -#ifdef DEVICE_ANALOGIN - -#define ADC_12BIT_RANGE 0xFFF -#define ADC_RANGE ADC_12BIT_RANGE - -static void analog_in_event_handler(nrf_drv_saadc_evt_t const *p_event)// type of nrf_drv_saadc_event_handler_t -{ - (void) p_event; -} - -static const nrf_drv_saadc_config_t saadc_config = -{ - .resolution = NRF_SAADC_RESOLUTION_12BIT, - .oversample = NRF_SAADC_OVERSAMPLE_DISABLED, - .interrupt_priority = SAADC_CONFIG_IRQ_PRIORITY -}; - -void SAADC_IRQHandler(void); - -void analogin_init(analogin_t *obj, PinName pin) -{ - ret_code_t ret_code; - - NVIC_SetVector(SAADC_IRQn, (uint32_t)SAADC_IRQHandler); - - ret_code = nrf_drv_saadc_init(&saadc_config, analog_in_event_handler); - MBED_ASSERT(((ret_code == NRF_SUCCESS) || (ret_code == NRF_ERROR_INVALID_STATE))); //NRF_ERROR_INVALID_STATE expected for multiple channels used. - - uint8_t saadcIn = nrf_drv_saadc_gpio_to_ain(pin); - MBED_ASSERT(saadcIn != NRF_SAADC_INPUT_DISABLED); - - obj->adc = ADC0_0; // only one instance of ADC in nRF52 SoC - obj->adc_pin = saadcIn - 1; - - nrf_saadc_channel_config_t channel_config = - NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(saadcIn); //Single ended, negative input to ADC shorted to GND. - - ret_code = nrf_drv_saadc_channel_init(obj->adc_pin, &channel_config); - MBED_ASSERT(ret_code == NRF_SUCCESS); -} - - -uint16_t analogin_read_u16(analogin_t *obj) -{ - int16_t adc_value; - ret_code_t ret_code; - - ret_code = nrf_drv_saadc_sample_convert(obj->adc_pin, &adc_value); - MBED_ASSERT(ret_code == NRF_SUCCESS); - - if (adc_value < 0) - { - // Even in the single ended mode measured value can be {-0}. Saturation for avoid casting to a big integer. - return 0; - } - else - { - return (uint16_t) adc_value; - } -} - -float analogin_read(analogin_t *obj) -{ - uint16_t value = analogin_read_u16(obj); - return (float)value * (1.0f / (float)ADC_RANGE); -} - -#endif // DEVICE_ANALOGIN diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/pwmout_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/pwmout_api.c deleted file mode 100644 index 97e29f256db..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/pwmout_api.c +++ /dev/null @@ -1,399 +0,0 @@ -/* - * Copyright (c) 2013 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "mbed_assert.h" -#include "mbed_error.h" -#include "pwmout_api.h" -#include "cmsis.h" -#include "pinmap.h" - -#if DEVICE_PWMOUT - -#include "app_util_platform.h" -#include "nrf_drv_pwm.h" - -#define MAX_PWM_COUNTERTOP (0x7FFF) // 0x7FFF is the max of COUNTERTOP value for the PWM peripherial of the nRF52. -#define MAX_PWM_PERIOD_US (MAX_PWM_COUNTERTOP * 8) // PWM hw is driven by 16 MHz clock, hence the tick is 1_us/16, - // and 128 is the max prescaler value. -#define MAX_PWM_PERIOD_MS ((MAX_PWM_PERIOD_US / 1000) + 1) // approximations advance -#define MAX_PWM_PERIOD_S ((MAX_PWM_PERIOD_US / 1000000) + 1) // approximations advance - - -#define PWM_INSTANCE_COUNT (PWM_COUNT) // import from the nrf_drv_config.h file - -///> instances of nRF52 PWM driver -static const nrf_drv_pwm_t m_pwm_driver[PWM_INSTANCE_COUNT] = -{ -#if PWM0_ENABLED - NRF_DRV_PWM_INSTANCE(0), -#endif -#if PWM1_ENABLED - NRF_DRV_PWM_INSTANCE(1), -#endif -#if PWM2_ENABLED - NRF_DRV_PWM_INSTANCE(2) -#endif -}; - -typedef struct -{ - uint32_t period_us; - uint32_t duty_us; - float duty; -} pwm_signal_t; /// PWM signal description type - -typedef struct -{ - nrf_drv_pwm_t * p_pwm_driver; - pwm_signal_t signal; - volatile nrf_pwm_values_common_t seq_values[1]; -} pwm_t; /// internal PWM instance support type - -static pwm_t m_pwm[PWM_INSTANCE_COUNT] = -{ -#if PWM0_ENABLED - {.p_pwm_driver = NULL}, -#endif -#if PWM1_ENABLED - {.p_pwm_driver = NULL}, -#endif -#if PWM2_ENABLED - {.p_pwm_driver = NULL} -#endif -}; /// Array of internal PWM instances. - -typedef struct -{ - uint16_t period_hwu; // unit related to pwm_clk - uint16_t duty_hwu; // unit related to pwm_clk - nrf_pwm_clk_t pwm_clk; -} pulsewidth_set_t; /// helper type for timing calculations - - -static void internal_pwmout_exe(pwmout_t *obj, bool new_period, bool initialization); - -// extern PWM nIRQ handler implementations -void PWM0_IRQHandler(void); -void PWM1_IRQHandler(void); -void PWM2_IRQHandler(void); - -static const peripheral_handler_desc_t pwm_handlers[PWM_INSTANCE_COUNT] = -{ - { - PWM0_IRQn, - (uint32_t)PWM0_IRQHandler - }, - { - PWM1_IRQn, - (uint32_t)PWM1_IRQHandler - }, - { - PWM2_IRQn, - (uint32_t)PWM2_IRQHandler - } -}; - -void pwmout_init(pwmout_t *obj, PinName pin) -{ - uint32_t i; - - for (i = 0; PWM_INSTANCE_COUNT; i++) - { - if (m_pwm[i].p_pwm_driver == NULL) // a driver instance not assigned to the obj? - { - NVIC_SetVector(pwm_handlers[i].IRQn, pwm_handlers[i].vector); - - obj->pin = pin; - - obj->pwm_channel = i; - - m_pwm[i].p_pwm_driver = (nrf_drv_pwm_t *) &m_pwm_driver[i]; - m_pwm[i].signal.period_us = 200000; // 0.02 s - m_pwm[i].signal.duty_us = 100000; - m_pwm[i].signal.duty = 0.5f; - - obj->pwm_struct = &m_pwm[i]; - - internal_pwmout_exe(obj, true, true); - - break; - } - } - - MBED_ASSERT(i != PWM_INSTANCE_COUNT); // assert if free instance was not found. -} - -void pwmout_free(pwmout_t *obj) -{ - nrf_drv_pwm_uninit( (nrf_drv_pwm_t*) obj->pwm_struct ); - - m_pwm[obj->pwm_channel].p_pwm_driver = NULL; -} - -void pwmout_write(pwmout_t *obj, float percent) -{ - - if (percent < 0) - { - percent = 0; - } - else if (percent > 1) - { - percent = 1; - } - - pwm_signal_t * p_pwm_signal = &(((pwm_t*)obj->pwm_struct)->signal); - - p_pwm_signal->duty = percent; - - int us = (((int)p_pwm_signal->period_us) * percent); - - pwmout_pulsewidth_us(obj, us); -} - -float pwmout_read(pwmout_t *obj) -{ - pwm_signal_t * p_pwm_signal = &(((pwm_t*)obj->pwm_struct)->signal); - - return (float)p_pwm_signal->duty_us / (float)p_pwm_signal->period_us; -} - -void pwmout_period(pwmout_t *obj, float seconds) -{ - // raught saturation < 0, quasi-max> - if (seconds > MAX_PWM_PERIOD_S) - { - seconds = MAX_PWM_PERIOD_S; - } - else if (seconds < 0) - { - seconds = 0; // f. pwmout_period_us will set period to min. value - } - - int us = seconds * 1000000; - - pwmout_period_us(obj, us); -} - -void pwmout_period_ms(pwmout_t *obj, int ms) -{ - // reught saturation < 0, quasi-max> - if (ms > MAX_PWM_PERIOD_MS) - { - ms = MAX_PWM_PERIOD_MS; - } - else if (ms < 0) - { - ms = 0; // f. pwmout_period_us will set period to min. value - } - - int us = ms * 1000; - - pwmout_period_us(obj, us); -} - - -void pwmout_period_us(pwmout_t *obj, int us) -{ - pwm_signal_t * p_pwm_signal = &(((pwm_t*)obj->pwm_struct)->signal); - - // saturation <1, real-max> - if (us > MAX_PWM_PERIOD_US) - { - us = MAX_PWM_PERIOD_US; - } - else if (us < 1) - { - us = 1; - } - - p_pwm_signal->duty_us = (int)((float)us * p_pwm_signal->duty); - - p_pwm_signal->period_us = us; - - internal_pwmout_exe(obj, true, false); -} - -void pwmout_pulsewidth(pwmout_t *obj, float seconds) -{ - // raught saturation < 0, quasi-max> - if (seconds > MAX_PWM_PERIOD_S) - { - seconds = MAX_PWM_PERIOD_S; - } - else if (seconds < 0) - { - seconds = 0; - } - - int us = seconds * 1000000; - - pwmout_pulsewidth_us(obj,us); -} - -void pwmout_pulsewidth_ms(pwmout_t *obj, int ms) -{ - // raught saturation < 0, quasi-max> - if (ms > MAX_PWM_PERIOD_MS) - { - ms = MAX_PWM_PERIOD_MS; - } - else if (ms < 0) - { - ms = 0; - } - - int us = ms * 1000; - - pwmout_pulsewidth_us(obj, us); -} - -void pwmout_pulsewidth_us(pwmout_t *obj, int us) -{ - // saturation <0, real-max> - if (us > MAX_PWM_PERIOD_US) - { - us = MAX_PWM_PERIOD_US; - } - else if (us < 0) - { - us = 0; - } - - pwm_signal_t * p_pwm_signal = &(((pwm_t*)obj->pwm_struct)->signal); - - p_pwm_signal->duty_us = us; - p_pwm_signal->duty = us / p_pwm_signal->period_us; - - internal_pwmout_exe(obj, false, false); -} - - - - - - -static ret_code_t pulsewidth_us_set_get(int period_hwu, int duty_hwu, pulsewidth_set_t * p_settings) -{ - uint16_t div; - nrf_pwm_clk_t pwm_clk = NRF_PWM_CLK_16MHz; - - for(div = 1; div <= 128 ; div <<= 1) // 128 is the maximum of clock prescaler for PWM peripherial - { - if (MAX_PWM_COUNTERTOP >= period_hwu) - { - p_settings->period_hwu = period_hwu; // unit [us/16 * div] - p_settings->duty_hwu = duty_hwu; // unit [us/16 * div] - p_settings->pwm_clk = pwm_clk; - - return NRF_SUCCESS; - } - - period_hwu >>= 1; - duty_hwu >>= 1; - pwm_clk++; - } - - return NRF_ERROR_INVALID_PARAM; -} - - -static void internal_pwmout_exe(pwmout_t *obj, bool new_period, bool initialization) -{ - pulsewidth_set_t pulsewidth_set; - pwm_signal_t * p_pwm_signal; - nrf_drv_pwm_t * p_pwm_driver; - ret_code_t ret_code; - - p_pwm_signal = &(((pwm_t*)obj->pwm_struct)->signal); - - if (NRF_SUCCESS == pulsewidth_us_set_get(p_pwm_signal->period_us * 16, // base clk for PWM is 16 MHz - p_pwm_signal->duty_us * 16, // base clk for PWM is 16 MHz - &pulsewidth_set)) - { - p_pwm_driver = (((pwm_t*)obj->pwm_struct)->p_pwm_driver); - - const nrf_pwm_sequence_t seq = - { - .values.p_common = (nrf_pwm_values_common_t*) (((pwm_t*)obj->pwm_struct)->seq_values), - .length = 1, - .repeats = 0, - .end_delay = 0 - }; - - (((pwm_t*)obj->pwm_struct)->seq_values)[0] = pulsewidth_set.duty_hwu | 0x8000; - - if (new_period) - { - nrf_drv_pwm_config_t config0 = - { - .output_pins = - { - obj->pin | NRF_DRV_PWM_PIN_INVERTED, // channel 0 - NRF_DRV_PWM_PIN_NOT_USED, // channel 1 - NRF_DRV_PWM_PIN_NOT_USED, // channel 2 - NRF_DRV_PWM_PIN_NOT_USED, // channel 3 - }, - .irq_priority = PWM0_CONFIG_IRQ_PRIORITY, - .base_clock = pulsewidth_set.pwm_clk, - .count_mode = NRF_PWM_MODE_UP, - .top_value = pulsewidth_set.period_hwu, - .load_mode = NRF_PWM_LOAD_COMMON, - .step_mode = NRF_PWM_STEP_AUTO - }; - - if (!initialization) - { - nrf_drv_pwm_uninit(p_pwm_driver); - } - - ret_code = nrf_drv_pwm_init( p_pwm_driver, &config0, NULL); - - MBED_ASSERT(ret_code == NRF_SUCCESS); // assert if free instance was not found. - } - - nrf_drv_pwm_simple_playback(p_pwm_driver, &seq, 0, NRF_DRV_PWM_FLAG_LOOP); - } - else - { - MBED_ASSERT(0); // force assertion - } - -} - -#endif // DEVICE_PWMOUT diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/sdk_patch/sdk_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/sdk_patch/sdk_config.h new file mode 100644 index 00000000000..e9a63353a9f --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/sdk_patch/sdk_config.h @@ -0,0 +1,21 @@ +#ifndef _SDK_CONFIG_H_ +#define _SDK_CONFIG_H_ + +#include "nrf_drv_config.h" + +#define UART_DEFAULT_CONFIG_BAUDRATE UART0_CONFIG_BAUDRATE +#define UART_DEFAULT_CONFIG_PARITY UART0_CONFIG_PARITY +#define UART_DEFAULT_CONFIG_HWFC UART0_CONFIG_HWFC +#define CTS_PIN_NUMBER UART0_CONFIG_PSEL_CTS +#define RTS_PIN_NUMBER UART0_CONFIG_PSEL_RTS + +#define SPIS_DEFAULT_ORC NRF_DRV_SPIS_DEFAULT_ORC +#define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY SPIS1_CONFIG_IRQ_PRIORITY; +#define SPIS_DEFAULT_ORC NRF_DRV_SPIS_DEFAULT_ORC +#define SPIS_DEFAULT_DEF NRF_DRV_SPIS_DEFAULT_DEF + +#define SPI_DEFAULT_CONFIG_IRQ_PRIORITY SPI1_CONFIG_IRQ_PRIORITY + +#define PWM_DEFAULT_CONFIG_IRQ_PRIORITY PWM0_CONFIG_IRQ_PRIORITY + +#endif \ No newline at end of file diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/PeripheralNames.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/PeripheralNames.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/PeripheralNames.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/PeripheralNames.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/PortNames.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/PortNames.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/PortNames.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/PortNames.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/PinNames.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/PinNames.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/PinNames.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/PinNames.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/startup_nrf52832.s b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/startup_nrf52832.s similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/startup_nrf52832.s rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/startup_nrf52832.s diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/sys.cpp b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/sys.cpp similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/sys.cpp rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/sys.cpp diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52832.S b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52832.S similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52832.S rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52832.S diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/startup_NRF52832_IAR.s b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/startup_NRF52832_IAR.s similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/startup_NRF52832_IAR.s rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/startup_NRF52832_IAR.s diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/cmsis.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/cmsis.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/cmsis.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/cmsis.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/cmsis_nvic.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/cmsis_nvic.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/cmsis_nvic.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/cmsis_nvic.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/cmsis_nvic.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/cmsis_nvic.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/cmsis_nvic.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/cmsis_nvic.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/system_nrf52840.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/system_nrf52840.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/system_nrf52840.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/system_nrf52840.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/system_nrf52840.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/system_nrf52840.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/system_nrf52840.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/system_nrf52840.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/sdk_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/sdk_config.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/sdk_config.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/sdk_config.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf52/nrf_mbr.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf52/nrf_mbr.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf52/nrf_mbr.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf52/nrf_mbr.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble.h index 86d4d9adffc..60b18442bc4 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble.h @@ -49,13 +49,13 @@ #ifndef BLE_H__ #define BLE_H__ -#include "ble_ranges.h" -#include "ble_types.h" -#include "ble_gap.h" -#include "ble_l2cap.h" -#include "ble_gatt.h" -#include "ble_gattc.h" -#include "ble_gatts.h" +#include "nrf_ble_ranges.h" +#include "nrf_ble_types.h" +#include "nrf_ble_gap.h" +#include "nrf_ble_l2cap.h" +#include "nrf_ble_gatt.h" +#include "nrf_ble_gattc.h" +#include "nrf_ble_gatts.h" #ifdef __cplusplus extern "C" { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_err.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_err.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_err.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_err.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gap.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gap.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gap.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gap.h index 7748702e822..8f651e21dd8 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gap.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gap.h @@ -45,8 +45,8 @@ #ifndef BLE_GAP_H__ #define BLE_GAP_H__ -#include "ble_types.h" -#include "ble_ranges.h" +#include "nrf_ble_types.h" +#include "nrf_ble_ranges.h" #include "nrf_svc.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gatt.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gatt.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gatt.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gatt.h index cfa3860b5fa..ceafee8a460 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gatt.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gatt.h @@ -45,8 +45,8 @@ #ifndef BLE_GATT_H__ #define BLE_GATT_H__ -#include "ble_types.h" -#include "ble_ranges.h" +#include "nrf_ble_types.h" +#include "nrf_ble_ranges.h" #ifdef __cplusplus extern "C" { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gattc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gattc.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gattc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gattc.h index c36a4d7e348..eb1f7753d76 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gattc.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gattc.h @@ -45,9 +45,9 @@ #ifndef BLE_GATTC_H__ #define BLE_GATTC_H__ -#include "ble_gatt.h" -#include "ble_types.h" -#include "ble_ranges.h" +#include "nrf_ble_gatt.h" +#include "nrf_ble_types.h" +#include "nrf_ble_ranges.h" #include "nrf_svc.h" #include "nrf_error.h" #include "nrf.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gatts.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gatts.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gatts.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gatts.h index b85735ec31c..588edcc0029 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_gatts.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_gatts.h @@ -45,11 +45,11 @@ #ifndef BLE_GATTS_H__ #define BLE_GATTS_H__ -#include "ble_types.h" -#include "ble_ranges.h" -#include "ble_l2cap.h" -#include "ble_gap.h" -#include "ble_gatt.h" +#include "nrf_ble_types.h" +#include "nrf_ble_ranges.h" +#include "nrf_ble_l2cap.h" +#include "nrf_ble_gap.h" +#include "nrf_ble_gatt.h" #include "nrf_svc.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_hci.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_hci.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_hci.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_hci.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_l2cap.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_l2cap.h similarity index 98% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_l2cap.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_l2cap.h index eaad7e50fc9..d3cc747b100 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_l2cap.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_l2cap.h @@ -45,9 +45,9 @@ #ifndef BLE_L2CAP_H__ #define BLE_L2CAP_H__ -#include "ble_types.h" -#include "ble_ranges.h" -#include "ble_err.h" +#include "nrf_ble_types.h" +#include "nrf_ble_ranges.h" +#include "nrf_ble_err.h" #include "nrf_svc.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_ranges.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_ranges.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_ranges.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_ranges.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/ble_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_ble_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_sdm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_sdm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_sdm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_sdm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_soc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_soc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_soc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_error_soc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_nvic.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_nvic.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_nvic.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_nvic.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sd_def.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sd_def.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sd_def.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sd_def.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sdm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sdm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sdm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_sdm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_soc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_soc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_soc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_soc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_svc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_svc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_svc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/headers/nrf_svc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/hex/s140_nrf52840_5.0.0-1.alpha_softdevice.hex b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/hex/s140_nrf52840_5.0.0-1.alpha_softdevice.hex similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/sdk/softdevice/s140/hex/s140_nrf52840_5.0.0-1.alpha_softdevice.hex rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/sdk/softdevice/s140/hex/s140_nrf52840_5.0.0-1.alpha_softdevice.hex diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_advertising/ble_advertising.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_advertising/ble_advertising.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_advertising/ble_advertising.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_advertising/ble_advertising.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_advertising/ble_advertising.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_advertising/ble_advertising.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_advertising/ble_advertising.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_advertising/ble_advertising.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_db_discovery/ble_db_discovery.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_db_discovery/ble_db_discovery.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_db_discovery/ble_db_discovery.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_db_discovery/ble_db_discovery.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_db_discovery/ble_db_discovery.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_db_discovery/ble_db_discovery.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_db_discovery/ble_db_discovery.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_db_discovery/ble_db_discovery.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_debug_assert_handler/ble_debug_assert_handler.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_debug_assert_handler/ble_debug_assert_handler.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_debug_assert_handler/ble_debug_assert_handler.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_debug_assert_handler/ble_debug_assert_handler.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_dtm/ble_dtm.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_dtm/ble_dtm.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_dtm/ble_dtm.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_dtm/ble_dtm.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_dtm/ble_dtm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_dtm/ble_dtm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_dtm/ble_dtm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_dtm/ble_dtm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_error_log/ble_error_log.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_error_log/ble_error_log.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_error_log/ble_error_log.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_error_log/ble_error_log.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_racp/ble_racp.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_racp/ble_racp.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_racp/ble_racp.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_racp/ble_racp.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_racp/ble_racp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_racp/ble_racp.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_racp/ble_racp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_racp/ble_racp.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_radio_notification/ble_radio_notification.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_radio_notification/ble_radio_notification.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_radio_notification/ble_radio_notification.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_radio_notification/ble_radio_notification.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_radio_notification/ble_radio_notification.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_radio_notification/ble_radio_notification.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_radio_notification/ble_radio_notification.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_radio_notification/ble_radio_notification.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_services/ble_dfu/ble_dfu.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_services/ble_dfu/ble_dfu.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_services/ble_dfu/ble_dfu.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_services/ble_dfu/ble_dfu.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_services/ble_dfu/ble_dfu.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_services/ble_dfu/ble_dfu.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/ble_services/ble_dfu/ble_dfu.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/ble_services/ble_dfu/ble_dfu.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_advdata.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_advdata.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_advdata.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_advdata.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_advdata.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_advdata.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_advdata.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_advdata.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_conn_params.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_conn_params.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_conn_params.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_conn_params.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_conn_state.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_conn_state.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_conn_state.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_conn_state.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_conn_state.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_conn_state.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_conn_state.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_conn_state.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_date_time.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_date_time.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_date_time.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_date_time.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_gatt_db.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_gatt_db.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_gatt_db.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_gatt_db.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_sensor_location.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_sensor_location.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_sensor_location.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_sensor_location.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_srv_common.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_srv_common.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_srv_common.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_srv_common.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_srv_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_srv_common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/common/ble_srv_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/common/ble_srv_common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/device_manager/config/device_manager_cnfg.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/device_manager/config/device_manager_cnfg.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/device_manager/config/device_manager_cnfg.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/device_manager/config/device_manager_cnfg.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/device_manager/device_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/device_manager/device_manager.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/device_manager/device_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/device_manager/device_manager.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/device_manager/device_manager_peripheral.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/device_manager/device_manager_peripheral.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/device_manager/device_manager_peripheral.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/device_manager/device_manager_peripheral.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatt_cache_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatt_cache_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatt_cache_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatt_cache_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatt_cache_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatt_cache_manager.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatt_cache_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatt_cache_manager.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gattc_cache_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gattc_cache_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gattc_cache_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gattc_cache_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gattc_cache_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gattc_cache_manager.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gattc_cache_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gattc_cache_manager.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatts_cache_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatts_cache_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatts_cache_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatts_cache_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatts_cache_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatts_cache_manager.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/gatts_cache_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/gatts_cache_manager.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/id_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/id_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/id_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/id_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/id_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/id_manager.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/id_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/id_manager.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data_storage.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data_storage.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data_storage.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data_storage.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data_storage.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data_storage.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_data_storage.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_data_storage.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_database.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_database.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_database.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_database.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_database.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_database.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_database.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_database.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_id.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_id.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_id.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_id.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_id.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_id.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_id.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_id.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager_internal.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager_internal.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/peer_manager_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/peer_manager_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_buffer.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_buffer.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_buffer.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_buffer.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_buffer.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_buffer.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_buffer.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_buffer.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_mutex.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_mutex.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_mutex.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_mutex.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_mutex.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_mutex.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_mutex.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/pm_mutex.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_dispatcher.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_dispatcher.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_dispatcher.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_dispatcher.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_dispatcher.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_dispatcher.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_dispatcher.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_dispatcher.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_manager.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/security_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/ble/peer_manager/security_manager.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/compiler_abstraction.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/compiler_abstraction.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/compiler_abstraction.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/compiler_abstraction.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51_bitfields.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51_bitfields.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51_bitfields.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51_bitfields.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51_deprecated.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51_deprecated.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51_deprecated.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51_deprecated.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51_to_nrf52.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51_to_nrf52.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf51_to_nrf52.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf51_to_nrf52.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf52.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf52.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf52.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf52.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf52_bitfields.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf52_bitfields.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf52_bitfields.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf52_bitfields.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf52_name_change.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf52_name_change.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/device/nrf52_name_change.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/device/nrf52_name_change.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ble_flash/ble_flash.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ble_flash/ble_flash.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ble_flash/ble_flash.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ble_flash/ble_flash.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ble_flash/ble_flash.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ble_flash/ble_flash.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ble_flash/ble_flash.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ble_flash/ble_flash.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/clock/nrf_drv_clock.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/clock/nrf_drv_clock.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/clock/nrf_drv_clock.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/clock/nrf_drv_clock.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/clock/nrf_drv_clock.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/clock/nrf_drv_clock.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/clock/nrf_drv_clock.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/clock/nrf_drv_clock.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/common/nrf_drv_common.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/common/nrf_drv_common.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/common/nrf_drv_common.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/common/nrf_drv_common.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/common/nrf_drv_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/common/nrf_drv_common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/common/nrf_drv_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/common/nrf_drv_common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/config/nrf_drv_config_validation.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/config/nrf_drv_config_validation.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/config/nrf_drv_config_validation.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/config/nrf_drv_config_validation.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/delay/nrf_delay.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/delay/nrf_delay.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/delay/nrf_delay.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/delay/nrf_delay.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/delay/nrf_delay.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/delay/nrf_delay.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/delay/nrf_delay.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/delay/nrf_delay.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/gpiote/nrf_drv_gpiote.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/gpiote/nrf_drv_gpiote.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/gpiote/nrf_drv_gpiote.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/gpiote/nrf_drv_gpiote.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_adc.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_adc.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_adc.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_adc.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_adc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_adc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_adc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_adc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_clock.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_clock.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_clock.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_clock.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_ecb.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_ecb.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_ecb.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_ecb.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_ecb.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_ecb.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_ecb.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_ecb.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_gpio.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_gpio.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_gpio.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_gpio.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_gpiote.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_gpiote.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_gpiote.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_gpiote.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_nvmc.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_nvmc.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_nvmc.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_nvmc.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_nvmc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_nvmc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_nvmc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_nvmc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_pdm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_pdm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_pdm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_pdm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_ppi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_ppi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_ppi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_ppi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_pwm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_pwm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_pwm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_pwm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_rtc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_rtc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_rtc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_rtc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_saadc.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_saadc.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_saadc.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_saadc.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_saadc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_saadc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_saadc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_saadc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_spi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_spi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_spi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_spi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_spim.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_spim.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_spim.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_spim.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_spis.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_spis.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_spis.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_spis.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_temp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_temp.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_temp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_temp.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_timer.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_timer.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_timer.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_timer.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_twi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_twi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_twi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_twi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_uart.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_uart.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_uart.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_uart.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_wdt.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_wdt.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/hal/nrf_wdt.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/hal/nrf_wdt.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ppi/nrf_drv_ppi.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ppi/nrf_drv_ppi.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ppi/nrf_drv_ppi.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ppi/nrf_drv_ppi.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ppi/nrf_drv_ppi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ppi/nrf_drv_ppi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/ppi/nrf_drv_ppi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/ppi/nrf_drv_ppi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/pstorage/config/pstorage_platform.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/pstorage/config/pstorage_platform.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/pstorage/config/pstorage_platform.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/pstorage/config/pstorage_platform.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/pstorage/pstorage.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/pstorage/pstorage.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/pstorage/pstorage.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/pstorage/pstorage.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/pstorage/pstorage.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/pstorage/pstorage.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/pstorage/pstorage.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/pstorage/pstorage.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_master/nrf_drv_spi.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_master/nrf_drv_spi.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_master/nrf_drv_spi.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_master/nrf_drv_spi.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_master/nrf_drv_spi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_master/nrf_drv_spi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_master/nrf_drv_spi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_master/nrf_drv_spi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_slave/nrf_drv_spis.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_slave/nrf_drv_spis.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_slave/nrf_drv_spis.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_slave/nrf_drv_spis.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_slave/nrf_drv_spis.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_slave/nrf_drv_spis.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/spi_slave/nrf_drv_spis.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/spi_slave/nrf_drv_spis.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/timer/nrf_drv_timer.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/timer/nrf_drv_timer.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/timer/nrf_drv_timer.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/timer/nrf_drv_timer.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/timer/nrf_drv_timer.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/timer/nrf_drv_timer.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/timer/nrf_drv_timer.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/drivers_nrf/timer/nrf_drv_timer.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_settings.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_settings.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_settings.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_settings.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_util.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_util.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_util.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_util.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_util.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_util.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/bootloader_util.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/bootloader_util.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_app_handler.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_app_handler.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_app_handler.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_app_handler.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_app_handler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_app_handler.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_app_handler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_app_handler.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_bank_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_bank_internal.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_bank_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_bank_internal.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_ble_svc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_ble_svc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_ble_svc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_ble_svc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_ble_svc_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_ble_svc_internal.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_ble_svc_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_ble_svc_internal.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_init.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_init.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_init.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_init.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_init_template.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_init_template.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_init_template.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_init_template.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_transport.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_transport.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_transport.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_transport.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/dfu_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/dfu_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/hci_transport/hci_transport_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/hci_transport/hci_transport_config.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/bootloader_dfu/hci_transport/hci_transport_config.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/bootloader_dfu/hci_transport/hci_transport_config.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/crc16/crc16.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/crc16/crc16.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/crc16/crc16.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/crc16/crc16.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/crc16/crc16.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/crc16/crc16.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/crc16/crc16.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/crc16/crc16.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/experimental_section_vars/section_vars.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/experimental_section_vars/section_vars.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/experimental_section_vars/section_vars.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/experimental_section_vars/section_vars.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/config/fds_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/config/fds_config.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/config/fds_config.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/config/fds_config.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/fds.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/fds.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/fds.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/fds.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/fds.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/fds.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/fds.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/fds.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/fds_internal_defs.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/fds_internal_defs.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fds/fds_internal_defs.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fds/fds_internal_defs.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/config/fstorage_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/config/fstorage_config.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/config/fstorage_config.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/config/fstorage_config.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage_internal_defs.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage_internal_defs.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage_internal_defs.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage_internal_defs.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage_nosd.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage_nosd.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/fstorage/fstorage_nosd.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/fstorage/fstorage_nosd.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/config/hci_mem_pool_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/config/hci_mem_pool_internal.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/config/hci_mem_pool_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/config/hci_mem_pool_internal.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/config/hci_transport_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/config/hci_transport_config.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/config/hci_transport_config.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/config/hci_transport_config.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/hci_mem_pool.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/hci_mem_pool.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/hci_mem_pool.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/hci_mem_pool.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/hci_mem_pool.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/hci_mem_pool.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/hci/hci_mem_pool.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/hci_mem_pool.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/pwm/app_pwm.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/pwm/app_pwm.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/pwm/app_pwm.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/pwm/app_pwm.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/pwm/app_pwm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/pwm/app_pwm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/pwm/app_pwm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/pwm/app_pwm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/scheduler/app_scheduler.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/scheduler/app_scheduler.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/scheduler/app_scheduler.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/scheduler/app_scheduler.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/scheduler/app_scheduler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/scheduler/app_scheduler.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/scheduler/app_scheduler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/scheduler/app_scheduler.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/trace/app_trace.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/trace/app_trace.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/trace/app_trace.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/trace/app_trace.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/trace/app_trace.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/trace/app_trace.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/trace/app_trace.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/trace/app_trace.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error_weak.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error_weak.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error_weak.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error_weak.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error_weak.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error_weak.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_error_weak.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_error_weak.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_bds.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util_bds.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_bds.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util_bds.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_platform.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util_platform.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_platform.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util_platform.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_platform.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util_platform.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_platform.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/app_util_platform.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nordic_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nordic_common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nordic_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nordic_common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_assert.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_assert.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_assert.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_assert.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_assert.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_assert.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_assert.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_assert.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_log.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_log.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_log.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_log.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_log.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_log.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/nrf_log.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/nrf_log.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_errors.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_errors.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_errors.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_errors.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_macros.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_macros.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_macros.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_macros.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_mapped_flags.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_mapped_flags.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_mapped_flags.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_mapped_flags.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_mapped_flags.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_mapped_flags.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_mapped_flags.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_mapped_flags.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_os.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_os.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_os.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_os.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_resources.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_resources.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/sdk_resources.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/util/sdk_resources.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/ant_stack_handler_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/ant_stack_handler_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/ant_stack_handler_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/ant_stack_handler_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/app_ram_base.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/app_ram_base.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/app_ram_base.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/app_ram_base.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/ble_stack_handler_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/ble_stack_handler_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/ble_stack_handler_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/ble_stack_handler_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler.h index 588ce1626a6..439dffa8b32 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler.h @@ -232,7 +232,7 @@ uint32_t softdevice_enable(ble_enable_params_t * p_ble_enable_params); /**@cond NO_DOXYGEN */ void intern_softdevice_events_execute(void); - +#define softdevice_handler_is_enabled softdevice_handler_isEnabled /**@endcond */ #endif // SOFTDEVICE_HANDLER_H__ diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler_appsh.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler_appsh.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler_appsh.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/softdevice/common/softdevice_handler/softdevice_handler_appsh.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_advertising/ble_advertising.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_advertising/ble_advertising.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_advertising/ble_advertising.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_advertising/ble_advertising.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_advertising/ble_advertising.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_advertising/ble_advertising.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_advertising/ble_advertising.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_advertising/ble_advertising.h index af409e8f18b..9b436d7a08f 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_advertising/ble_advertising.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_advertising/ble_advertising.h @@ -62,8 +62,8 @@ #include #include "nrf_error.h" -#include "headers/ble.h" -#include "ble_gattc.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gattc.h" #include "ble_advdata.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_db_discovery/ble_db_discovery.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_db_discovery/ble_db_discovery.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_db_discovery/ble_db_discovery.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_db_discovery/ble_db_discovery.c index eba5b3285de..96bbe91a224 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_db_discovery/ble_db_discovery.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_db_discovery/ble_db_discovery.c @@ -40,7 +40,7 @@ #if NRF_MODULE_ENABLED(BLE_DB_DISCOVERY) #include "ble_db_discovery.h" #include -#include "headers\ble.h" +#include "headers/nrf_ble.h" #include "ble_srv_common.h" #define NRF_LOG_MODULE_NAME "BLE_DB_DISC" #include "nrf_log.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_db_discovery/ble_db_discovery.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_db_discovery/ble_db_discovery.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_db_discovery/ble_db_discovery.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_db_discovery/ble_db_discovery.h index 0372a68fad4..dccfe70ad60 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_db_discovery/ble_db_discovery.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_db_discovery/ble_db_discovery.h @@ -70,8 +70,8 @@ #include #include "nrf_error.h" -#include "headers\ble.h" -#include "ble_gattc.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gattc.h" #include "ble_srv_common.h" #include "ble_gatt_db.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_debug_assert_handler/ble_debug_assert_handler.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_debug_assert_handler/ble_debug_assert_handler.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_debug_assert_handler/ble_debug_assert_handler.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_debug_assert_handler/ble_debug_assert_handler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_debug_assert_handler/ble_debug_assert_handler.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm_hw.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm_hw.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm_hw.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm_hw.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm_hw_nrf52.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm_hw_nrf52.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_dtm/ble_dtm_hw_nrf52.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_dtm/ble_dtm_hw_nrf52.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_error_log/ble_error_log.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_error_log/ble_error_log.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_error_log/ble_error_log.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_error_log/ble_error_log.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_racp/ble_racp.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_racp/ble_racp.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_racp/ble_racp.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_racp/ble_racp.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_racp/ble_racp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_racp/ble_racp.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_racp/ble_racp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_racp/ble_racp.h index a6a60614ce2..97b8f56d4c9 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_racp/ble_racp.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_racp/ble_racp.h @@ -49,8 +49,8 @@ #include #include -#include "headers\ble.h" -#include "ble_types.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_types.h" #ifdef __cplusplus extern "C" { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_radio_notification/ble_radio_notification.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_radio_notification/ble_radio_notification.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_radio_notification/ble_radio_notification.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_radio_notification/ble_radio_notification.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_radio_notification/ble_radio_notification.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_radio_notification/ble_radio_notification.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_radio_notification/ble_radio_notification.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/ble_radio_notification/ble_radio_notification.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_advdata.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_advdata.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_advdata.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_advdata.c index f114952fba3..9dcc8201cff 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_advdata.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_advdata.c @@ -37,7 +37,7 @@ */ #include "ble_advdata.h" -#include "ble_gap.h" +#include "headers/nrf_ble_gap.h" #include "ble_srv_common.h" #include "sdk_common.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_advdata.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_advdata.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_advdata.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_advdata.h index d67ca5fab7a..d9bb01a7699 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_advdata.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_advdata.h @@ -51,7 +51,7 @@ #include #include #include -#include "headers/ble.h" +#include "headers/nrf_ble.h" #include "app_util.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_params.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_params.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_params.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_params.h index eaf7d84a719..f9ff64c12d3 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_params.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_params.h @@ -48,7 +48,7 @@ #define BLE_CONN_PARAMS_H__ #include -#include "headers/ble.h" +#include "headers/nrf_ble.h" #include "ble_srv_common.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_state.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_state.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_state.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_state.c index 6303b50f2cb..b4fb337a2ed 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_state.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_state.c @@ -40,7 +40,7 @@ #include #include #include -#include "headers/ble.h" +#include "headers/nrf_ble.h" #include "sdk_mapped_flags.h" #include "app_error.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_state.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_state.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_state.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_state.h index 8a4417df19a..e310f7b3b5f 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_conn_state.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_conn_state.h @@ -68,7 +68,7 @@ #include #include -#include "headers/ble.h" +#include "headers/nrf_ble.h" #include "sdk_mapped_flags.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_date_time.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_date_time.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_date_time.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_date_time.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_gatt_db.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_gatt_db.h similarity index 98% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_gatt_db.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_gatt_db.h index 712e0520d11..9d6f0e87f63 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_gatt_db.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_gatt_db.h @@ -47,8 +47,8 @@ #define BLE_GATT_DB_H__ #include -#include "headers/ble.h" -#include "ble_gattc.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gattc.h" #ifdef __cplusplus extern "C" { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_sensor_location.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_sensor_location.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_sensor_location.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_sensor_location.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_srv_common.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_srv_common.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_srv_common.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_srv_common.c index 5f3dd17df3a..8b821cdbc66 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_srv_common.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_srv_common.c @@ -45,7 +45,7 @@ #include #include "nordic_common.h" #include "app_error.h" -#include "headers/ble.h" +#include "headers/nrf_ble.h" bool ble_srv_is_notification_enabled(uint8_t const * p_encoded_data) { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_srv_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_srv_common.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_srv_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_srv_common.h index 660e9bf7f5f..85df97e00bc 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/common/ble_srv_common.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/common/ble_srv_common.h @@ -49,11 +49,11 @@ #include #include -#include "ble_types.h" +#include "headers/nrf_ble_types.h" #include "app_util.h" -#include "headers/ble.h" -#include "ble_gap.h" -#include "ble_gatt.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" +#include "headers/nrf_ble_gatt.h" #ifdef __cplusplus extern "C" { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatt_cache_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatt_cache_manager.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatt_cache_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatt_cache_manager.c index ba19efadd35..0e2f2a1835b 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatt_cache_manager.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatt_cache_manager.c @@ -40,7 +40,7 @@ #if NRF_MODULE_ENABLED(PEER_MANAGER) #include "gatt_cache_manager.h" -#include "ble_gap.h" +#include "headers/nrf_ble_gap.h" #include "ble_conn_state.h" #include "peer_manager_types.h" #include "peer_manager_internal.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatt_cache_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatt_cache_manager.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatt_cache_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatt_cache_manager.h index fe95dba5452..79d4d718364 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatt_cache_manager.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatt_cache_manager.h @@ -42,8 +42,8 @@ #include #include "sdk_errors.h" -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatts_cache_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatts_cache_manager.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatts_cache_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatts_cache_manager.c index 3f6b89c8bc1..3f4ac470606 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatts_cache_manager.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatts_cache_manager.c @@ -41,7 +41,7 @@ #include "gatts_cache_manager.h" #include -#include "ble_gap.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #include "peer_manager_internal.h" #include "peer_database.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatts_cache_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatts_cache_manager.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatts_cache_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatts_cache_manager.h index 628276ceab3..48c314d215f 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/gatts_cache_manager.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/gatts_cache_manager.h @@ -42,8 +42,8 @@ #include #include "sdk_errors.h" -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/id_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/id_manager.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/id_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/id_manager.c index b999a852770..03cf432591d 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/id_manager.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/id_manager.c @@ -41,8 +41,8 @@ #include "id_manager.h" #include -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "ble_conn_state.h" #include "peer_manager_types.h" #include "peer_database.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/id_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/id_manager.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/id_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/id_manager.h index e680f410898..2268884460e 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/id_manager.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/id_manager.h @@ -42,8 +42,8 @@ #include #include "sdk_errors.h" -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data_storage.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data_storage.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data_storage.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data_storage.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data_storage.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data_storage.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data_storage.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data_storage.h index f9b63499245..0b6343e7a4d 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_data_storage.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_data_storage.h @@ -43,7 +43,7 @@ #include #include "sdk_errors.h" -#include "ble_gap.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #include "peer_manager_internal.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_database.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_database.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_database.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_database.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_database.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_database.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_database.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_database.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_id.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_id.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_id.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_id.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_id.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_id.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_id.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_id.h index 0c1116c8cb0..1e05ac5a9e3 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_id.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_id.h @@ -43,7 +43,7 @@ #include #include "sdk_errors.h" -#include "ble_gap.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager.h index b5cc5af7819..ee257546748 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager.h @@ -62,8 +62,8 @@ #include #include #include "sdk_common.h" -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #include "peer_database.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager_internal.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager_internal.h index 79551404e9c..c66bd3dd530 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager_internal.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager_internal.h @@ -42,8 +42,8 @@ #include #include "sdk_errors.h" -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager_types.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager_types.h index 7e085b26c2d..a934e14c72c 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/peer_manager_types.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/peer_manager_types.h @@ -51,8 +51,8 @@ #include #include #include "nrf.h" -#include "ble_gap.h" -#include "ble_hci.h" +#include "headers/nrf_ble_gap.h" +#include "headers/nrf_ble_hci.h" #include "ble_gatt_db.h" #include "app_util.h" #include "app_util_platform.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_buffer.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_buffer.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_buffer.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_buffer.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_buffer.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_buffer.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_buffer.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_buffer.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_mutex.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_mutex.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_mutex.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_mutex.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_mutex.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_mutex.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/pm_mutex.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/pm_mutex.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_dispatcher.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_dispatcher.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_dispatcher.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_dispatcher.c index a87030bf340..723a6a9777c 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_dispatcher.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_dispatcher.c @@ -41,8 +41,8 @@ #include "security_dispatcher.h" #include -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "ble_conn_state.h" #include "peer_manager_types.h" #include "peer_database.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_dispatcher.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_dispatcher.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_dispatcher.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_dispatcher.h index 7d0b45dc46e..92f8365b64b 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_dispatcher.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_dispatcher.h @@ -42,8 +42,8 @@ #include #include "sdk_errors.h" -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #ifdef __cplusplus diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_manager.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_manager.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_manager.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_manager.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_manager.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_manager.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_manager.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_manager.h index c1043a6a3da..73cb69c1c89 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/peer_manager/security_manager.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/ble/peer_manager/security_manager.h @@ -42,8 +42,8 @@ #include #include "sdk_errors.h" -#include "headers/ble.h" -#include "ble_gap.h" +#include "headers/nrf_ble.h" +#include "headers/nrf_ble_gap.h" #include "peer_manager_types.h" #include "security_dispatcher.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/arduino_primo.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/arduino_primo.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/arduino_primo.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/arduino_primo.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/boards.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/boards.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/boards.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/boards.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/boards.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/boards.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/boards.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/boards.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/d52_starterkit.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/d52_starterkit.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/d52_starterkit.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/d52_starterkit.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/n5_starterkit.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/n5_starterkit.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/n5_starterkit.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/n5_starterkit.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/nrf6310.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/nrf6310.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/nrf6310.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/nrf6310.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10000.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10000.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10000.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10000.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10001.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10001.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10001.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10001.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10003.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10003.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10003.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10003.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10028.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10028.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10028.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10028.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10031.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10031.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10031.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10031.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10036.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10036.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10036.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10036.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10040.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10040.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10040.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10040.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10056.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10056.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca10056.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca10056.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca20006.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca20006.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/pca20006.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/pca20006.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/wt51822.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/wt51822.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/boards/wt51822.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/boards/wt51822.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/compiler_abstraction.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/compiler_abstraction.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/compiler_abstraction.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/compiler_abstraction.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51422_peripherals.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51422_peripherals.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51422_peripherals.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51422_peripherals.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51802_peripherals.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51802_peripherals.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51802_peripherals.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51802_peripherals.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51822_peripherals.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51822_peripherals.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51822_peripherals.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51822_peripherals.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_bitfields.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_bitfields.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_bitfields.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_bitfields.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_deprecated.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_deprecated.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_deprecated.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_deprecated.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_to_nrf52.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_to_nrf52.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_to_nrf52.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_to_nrf52.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_to_nrf52840.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_to_nrf52840.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf51_to_nrf52840.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf51_to_nrf52840.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52832_peripherals.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52832_peripherals.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52832_peripherals.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52832_peripherals.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52840.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52840.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52840.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52840.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52840_bitfields.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52840_bitfields.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52840_bitfields.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52840_bitfields.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52840_peripherals.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52840_peripherals.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52840_peripherals.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52840_peripherals.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52_bitfields.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52_bitfields.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52_bitfields.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52_bitfields.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52_name_change.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52_name_change.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52_name_change.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52_name_change.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52_to_nrf52840.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52_to_nrf52840.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/device/nrf52_to_nrf52840.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/device/nrf52_to_nrf52840.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ble_flash/ble_flash.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ble_flash/ble_flash.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ble_flash/ble_flash.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ble_flash/ble_flash.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ble_flash/ble_flash.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ble_flash/ble_flash.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ble_flash/ble_flash.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ble_flash/ble_flash.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/clock/nrf_drv_clock.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/clock/nrf_drv_clock.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/clock/nrf_drv_clock.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/clock/nrf_drv_clock.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/clock/nrf_drv_clock.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/clock/nrf_drv_clock.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/clock/nrf_drv_clock.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/clock/nrf_drv_clock.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/common/nrf_drv_common.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/common/nrf_drv_common.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/common/nrf_drv_common.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/common/nrf_drv_common.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/common/nrf_drv_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/common/nrf_drv_common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/common/nrf_drv_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/common/nrf_drv_common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/comp/nrf_drv_comp.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/comp/nrf_drv_comp.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/comp/nrf_drv_comp.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/comp/nrf_drv_comp.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/comp/nrf_drv_comp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/comp/nrf_drv_comp.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/comp/nrf_drv_comp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/comp/nrf_drv_comp.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/delay/nrf_delay.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/delay/nrf_delay.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/delay/nrf_delay.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/delay/nrf_delay.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/gpiote/nrf_drv_gpiote.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/gpiote/nrf_drv_gpiote.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/gpiote/nrf_drv_gpiote.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/gpiote/nrf_drv_gpiote.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/gpiote/nrf_drv_gpiote.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_clock.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_clock.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_clock.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_clock.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_comp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_comp.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_comp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_comp.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_ecb.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_ecb.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_ecb.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_ecb.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_ecb.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_ecb.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_ecb.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_ecb.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_egu.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_egu.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_egu.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_egu.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_gpio.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_gpio.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_gpio.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_gpio.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_gpiote.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_gpiote.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_gpiote.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_gpiote.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_i2s.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_i2s.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_i2s.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_i2s.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_lpcomp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_lpcomp.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_lpcomp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_lpcomp.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_nvmc.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_nvmc.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_nvmc.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_nvmc.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_nvmc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_nvmc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_nvmc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_nvmc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_pdm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_pdm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_pdm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_pdm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_peripherals.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_peripherals.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_peripherals.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_peripherals.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_power.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_power.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_power.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_power.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_ppi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_ppi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_ppi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_ppi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_pwm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_pwm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_pwm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_pwm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_qdec.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_qdec.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_qdec.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_qdec.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_rng.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_rng.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_rng.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_rng.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_rtc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_rtc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_rtc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_rtc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_saadc.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_saadc.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_saadc.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_saadc.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_saadc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_saadc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_saadc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_saadc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_spi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_spi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_spi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_spi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_spim.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_spim.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_spim.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_spim.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_spis.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_spis.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_spis.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_spis.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_temp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_temp.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_temp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_temp.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_timer.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_timer.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_timer.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_timer.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_twi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_twi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_twi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_twi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_twim.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_twim.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_twim.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_twim.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_twis.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_twis.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_twis.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_twis.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_uart.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_uart.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_uart.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_uart.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_uarte.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_uarte.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_uarte.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_uarte.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_wdt.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_wdt.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/hal/nrf_wdt.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/hal/nrf_wdt.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/i2s/nrf_drv_i2s.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/i2s/nrf_drv_i2s.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/i2s/nrf_drv_i2s.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/i2s/nrf_drv_i2s.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/i2s/nrf_drv_i2s.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/i2s/nrf_drv_i2s.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/i2s/nrf_drv_i2s.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/i2s/nrf_drv_i2s.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/lpcomp/nrf_drv_lpcomp.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/lpcomp/nrf_drv_lpcomp.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/lpcomp/nrf_drv_lpcomp.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/lpcomp/nrf_drv_lpcomp.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/lpcomp/nrf_drv_lpcomp.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/lpcomp/nrf_drv_lpcomp.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/lpcomp/nrf_drv_lpcomp.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/lpcomp/nrf_drv_lpcomp.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pdm/nrf_drv_pdm.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pdm/nrf_drv_pdm.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pdm/nrf_drv_pdm.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pdm/nrf_drv_pdm.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pdm/nrf_drv_pdm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pdm/nrf_drv_pdm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pdm/nrf_drv_pdm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pdm/nrf_drv_pdm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/power/nrf_drv_power.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/power/nrf_drv_power.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/power/nrf_drv_power.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/power/nrf_drv_power.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/power/nrf_drv_power.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/power/nrf_drv_power.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/power/nrf_drv_power.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/power/nrf_drv_power.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ppi/nrf_drv_ppi.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ppi/nrf_drv_ppi.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ppi/nrf_drv_ppi.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ppi/nrf_drv_ppi.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ppi/nrf_drv_ppi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ppi/nrf_drv_ppi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/ppi/nrf_drv_ppi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/ppi/nrf_drv_ppi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pwm/nrf_drv_pwm.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pwm/nrf_drv_pwm.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pwm/nrf_drv_pwm.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pwm/nrf_drv_pwm.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pwm/nrf_drv_pwm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pwm/nrf_drv_pwm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/pwm/nrf_drv_pwm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/pwm/nrf_drv_pwm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/qdec/nrf_drv_qdec.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/qdec/nrf_drv_qdec.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/qdec/nrf_drv_qdec.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/qdec/nrf_drv_qdec.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/qdec/nrf_drv_qdec.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/qdec/nrf_drv_qdec.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/qdec/nrf_drv_qdec.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/qdec/nrf_drv_qdec.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/radio_config/radio_config.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/radio_config/radio_config.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/radio_config/radio_config.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/radio_config/radio_config.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/radio_config/radio_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/radio_config/radio_config.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/radio_config/radio_config.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/radio_config/radio_config.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rng/nrf_drv_rng.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rng/nrf_drv_rng.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rng/nrf_drv_rng.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rng/nrf_drv_rng.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rng/nrf_drv_rng.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rng/nrf_drv_rng.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rng/nrf_drv_rng.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rng/nrf_drv_rng.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rtc/nrf_drv_rtc.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rtc/nrf_drv_rtc.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rtc/nrf_drv_rtc.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rtc/nrf_drv_rtc.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rtc/nrf_drv_rtc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rtc/nrf_drv_rtc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/rtc/nrf_drv_rtc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/rtc/nrf_drv_rtc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/saadc/nrf_drv_saadc.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/saadc/nrf_drv_saadc.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/saadc/nrf_drv_saadc.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/saadc/nrf_drv_saadc.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/saadc/nrf_drv_saadc.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/saadc/nrf_drv_saadc.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/saadc/nrf_drv_saadc.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/saadc/nrf_drv_saadc.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/sdio/config/sdio_config.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/sdio/config/sdio_config.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/sdio/config/sdio_config.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/sdio/config/sdio_config.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/sdio/sdio.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/sdio/sdio.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/sdio/sdio.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/sdio/sdio.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/sdio/sdio.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/sdio/sdio.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/sdio/sdio.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/sdio/sdio.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_master/nrf_drv_spi.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_master/nrf_drv_spi.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_master/nrf_drv_spi.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_master/nrf_drv_spi.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_master/nrf_drv_spi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_master/nrf_drv_spi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_master/nrf_drv_spi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_master/nrf_drv_spi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_slave/nrf_drv_spis.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_slave/nrf_drv_spis.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_slave/nrf_drv_spis.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_slave/nrf_drv_spis.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_slave/nrf_drv_spis.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_slave/nrf_drv_spis.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_slave/nrf_drv_spis.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/spi_slave/nrf_drv_spis.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/timer/nrf_drv_timer.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/timer/nrf_drv_timer.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/timer/nrf_drv_timer.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/timer/nrf_drv_timer.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/timer/nrf_drv_timer.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/timer/nrf_drv_timer.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/timer/nrf_drv_timer.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/timer/nrf_drv_timer.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twi_master/nrf_drv_twi.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twi_master/nrf_drv_twi.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twi_master/nrf_drv_twi.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twi_master/nrf_drv_twi.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twi_master/nrf_drv_twi.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twi_master/nrf_drv_twi.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twi_master/nrf_drv_twi.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twi_master/nrf_drv_twi.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twis_slave/nrf_drv_twis.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twis_slave/nrf_drv_twis.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twis_slave/nrf_drv_twis.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twis_slave/nrf_drv_twis.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twis_slave/nrf_drv_twis.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twis_slave/nrf_drv_twis.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twis_slave/nrf_drv_twis.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twis_slave/nrf_drv_twis.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twis_slave/nrf_drv_twis_inst.def b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twis_slave/nrf_drv_twis_inst.def similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/twis_slave/nrf_drv_twis_inst.def rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/twis_slave/nrf_drv_twis_inst.def diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/wdt/nrf_drv_wdt.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/wdt/nrf_drv_wdt.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/wdt/nrf_drv_wdt.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/wdt/nrf_drv_wdt.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/wdt/nrf_drv_wdt.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/wdt/nrf_drv_wdt.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/wdt/nrf_drv_wdt.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/drivers_nrf/wdt/nrf_drv_wdt.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_flash.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_flash.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_flash.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_flash.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_flash.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_flash.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_flash.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_flash.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_req_handler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_req_handler.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_req_handler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_req_handler.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_transport.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_transport.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_transport.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_transport.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_transport.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_transport.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_transport.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_transport.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/bootloader/dfu/nrf_dfu_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/bootloader/dfu/nrf_dfu_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc16/crc16.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc16/crc16.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc16/crc16.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc16/crc16.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc16/crc16.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc16/crc16.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc16/crc16.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc16/crc16.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc32/crc32.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc32/crc32.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc32/crc32.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc32/crc32.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc32/crc32.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc32/crc32.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/crc32/crc32.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/crc32/crc32.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/experimental_section_vars/section_vars.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/experimental_section_vars/section_vars.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/experimental_section_vars/section_vars.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/experimental_section_vars/section_vars.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fds/fds.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fds/fds.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fds/fds.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fds/fds.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fds/fds.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fds/fds.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fds/fds.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fds/fds.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fds/fds_internal_defs.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fds/fds_internal_defs.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fds/fds_internal_defs.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fds/fds_internal_defs.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage_internal_defs.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage_internal_defs.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage_internal_defs.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage_internal_defs.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage_nosd.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage_nosd.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/fstorage/fstorage_nosd.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/fstorage/fstorage_nosd.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/hci/hci_mem_pool.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/hci/hci_mem_pool.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/hci/hci_mem_pool.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/hci/hci_mem_pool.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/hci/hci_mem_pool.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/hci/hci_mem_pool.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/hci/hci_mem_pool.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/hci/hci_mem_pool.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/nrf_log.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/nrf_log.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/nrf_log.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/nrf_log.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/nrf_log_backend.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/nrf_log_backend.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/nrf_log_backend.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/nrf_log_backend.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/nrf_log_ctrl.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/nrf_log_ctrl.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/nrf_log_ctrl.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/nrf_log_ctrl.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_backend_serial.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_backend_serial.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_backend_serial.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_backend_serial.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_ctrl_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_ctrl_internal.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_ctrl_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_ctrl_internal.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_frontend.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_frontend.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_frontend.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_frontend.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_internal.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_internal.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/log/src/nrf_log_internal.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/log/src/nrf_log_internal.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/pwm/app_pwm.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/pwm/app_pwm.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/pwm/app_pwm.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/pwm/app_pwm.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/pwm/app_pwm.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/pwm/app_pwm.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/pwm/app_pwm.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/pwm/app_pwm.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/queue/nrf_queue.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/queue/nrf_queue.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/queue/nrf_queue.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/queue/nrf_queue.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/queue/nrf_queue.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/queue/nrf_queue.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/queue/nrf_queue.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/queue/nrf_queue.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/scheduler/app_scheduler.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/scheduler/app_scheduler.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/scheduler/app_scheduler.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/scheduler/app_scheduler.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/scheduler/app_scheduler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/scheduler/app_scheduler.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/scheduler/app_scheduler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/scheduler/app_scheduler.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error_weak.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error_weak.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error_weak.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error_weak.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error_weak.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error_weak.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_error_weak.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_error_weak.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util_bds.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util_bds.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util_bds.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util_bds.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util_platform.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util_platform.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util_platform.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util_platform.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util_platform.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util_platform.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/app_util_platform.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/app_util_platform.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nordic_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nordic_common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nordic_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nordic_common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nrf_assert.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nrf_assert.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nrf_assert.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nrf_assert.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nrf_assert.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nrf_assert.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nrf_assert.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nrf_assert.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nrf_bitmask.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nrf_bitmask.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/nrf_bitmask.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/nrf_bitmask.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_common.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_common.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_common.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_common.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_errors.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_errors.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_errors.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_errors.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_macros.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_macros.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_macros.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_macros.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_mapped_flags.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_mapped_flags.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_mapped_flags.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_mapped_flags.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_mapped_flags.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_mapped_flags.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_mapped_flags.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_mapped_flags.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_os.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_os.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_os.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_os.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_resources.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_resources.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/libraries/util/sdk_resources.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/libraries/util/sdk_resources.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/sdk_validation.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/sdk_validation.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/sdk_validation.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/sdk_validation.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/ant_stack_handler_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/ant_stack_handler_types.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/ant_stack_handler_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/ant_stack_handler_types.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/app_ram_base.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/app_ram_base.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/app_ram_base.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/app_ram_base.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/ble_stack_handler_types.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/ble_stack_handler_types.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/ble_stack_handler_types.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/ble_stack_handler_types.h index 7be7850f581..30da33c7569 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/ble_stack_handler_types.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/ble_stack_handler_types.h @@ -55,7 +55,7 @@ extern "C" { #ifdef BLE_STACK_SUPPORT_REQD #include -#include "headers/ble.h" +#include "headers/nrf_ble.h" #include "nrf_sdm.h" #include "app_error.h" #include "app_util.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler.c index 34e534e9f65..868532b4851 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler.c @@ -62,7 +62,7 @@ #elif defined(ANT_STACK_SUPPORT_REQD) #include "ant_interface.h" #elif defined(BLE_STACK_SUPPORT_REQD) - #include "headers/ble.h" + #include "headers/nrf_ble.h" #endif #define RAM_START_ADDRESS 0x20000000 diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler.h similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler.h index 59bc60f3d5a..64d4465be03 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler.h @@ -66,7 +66,7 @@ #include "ble_stack_handler_types.h" #include "ant_stack_handler_types.h" #if defined(BLE_STACK_SUPPORT_REQD) - #include "headers/ble.h" + #include "headers/nrf_ble.h" #endif #include "app_ram_base.h" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler_appsh.c similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.c rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler_appsh.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler_appsh.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/softdevice/common/softdevice_handler/softdevice_handler_appsh.h rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK13/softdevice/common/softdevice_handler/softdevice_handler_appsh.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/analogin_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/analogin_api.c similarity index 96% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/analogin_api.c rename to targets/TARGET_NORDIC/TARGET_NRF5/analogin_api.c index dcc0f44f0dd..8dec19a34bf 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/analogin_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/analogin_api.c @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#ifndef TARGET_MCU_NRF51822 #include "mbed_assert.h" #include "analogin_api.h" @@ -26,7 +28,9 @@ #define ADC_12BIT_RANGE 0xFFF #define ADC_RANGE ADC_12BIT_RANGE +#ifdef TARGET_SDK13 __STATIC_INLINE nrf_saadc_input_t nrf_drv_saadc_gpio_to_ain(uint32_t pin); +#endif static void analog_in_event_handler(nrf_drv_saadc_evt_t const *p_event)// type of nrf_drv_saadc_event_handler_t @@ -91,7 +95,7 @@ float analogin_read(analogin_t *obj) return (float)value * (1.0f / (float)ADC_RANGE); } - +#ifdef TARGET_SDK13 /** * @brief Function for converting a GPIO pin number to an analog input pin number used in the channel * configuration. @@ -119,5 +123,8 @@ __STATIC_INLINE nrf_saadc_input_t nrf_drv_saadc_gpio_to_ain(uint32_t pin) return NRF_SAADC_INPUT_DISABLED; } } +#endif // TARGET_SDK13 #endif // DEVICE_ANALOGIN + +#endif // !TARGET_MCU_NRF51822 diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/gpio_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/gpio_api.c index a5c6c850c21..ec73afa6a3f 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/gpio_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/gpio_api.c @@ -22,8 +22,12 @@ #if defined(TARGET_MCU_NRF51822) #define GPIO_PIN_COUNT 31 -#else +#elif defined(TARGET_MCU_NRF52832) #define GPIO_PIN_COUNT 32 +#elif defined(TARGET_MCU_NRF52840) + #define GPIO_PIN_COUNT 48 +#else + #error not recognized gpio count for mcu #endif typedef struct { @@ -36,8 +40,14 @@ typedef struct { bool irq_rise : 1; } gpio_cfg_t; -uint32_t m_gpio_initialized; -gpio_cfg_t m_gpio_cfg[GPIO_PIN_COUNT]; +#if GPIO_PIN_COUNT > 32 + typedef uint64_t gpio_mask_t; +#else + typedef uint32_t gpio_mask_t; +#endif + +static gpio_mask_t m_gpio_initialized; +static gpio_cfg_t m_gpio_cfg[GPIO_PIN_COUNT]; /*********** @@ -46,7 +56,7 @@ gpio_cfg_t m_gpio_cfg[GPIO_PIN_COUNT]; static gpio_irq_handler m_irq_handler; static uint32_t m_channel_ids[GPIO_PIN_COUNT] = {0}; -uint32_t m_gpio_irq_enabled; +static gpio_mask_t m_gpio_irq_enabled; static void gpiote_irq_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) @@ -54,7 +64,7 @@ static void gpiote_irq_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t a nrf_gpio_pin_sense_t sense = nrf_gpio_pin_sense_get(pin); gpio_irq_event event = (sense == NRF_GPIO_PIN_SENSE_LOW) ? IRQ_RISE : IRQ_FALL; - if (m_gpio_irq_enabled & (1UL << pin)) { + if (m_gpio_irq_enabled & ((gpio_mask_t)1 << pin)) { if (((event == IRQ_RISE) && m_gpio_cfg[pin].irq_rise) || ((event == IRQ_FALL) && m_gpio_cfg[pin].irq_fall)) { m_irq_handler(m_channel_ids[pin], event); @@ -79,12 +89,19 @@ void gpio_init(gpio_t *obj, PinName pin) m_gpio_cfg[obj->pin].used_as_gpio = true; } +#ifdef TARGET_SDK11 +// implement polyfill of gpio hal for the nRF5 SDK v11 +__STATIC_INLINE uint32_t nrf_gpio_pin_out_read(uint32_t pin) +{ + return (NRF_GPIO->OUTSET & (1UL << (pin))); +} +#endif int gpio_read(gpio_t *obj) { MBED_ASSERT(obj->pin != (PinName)NC); if (m_gpio_cfg[obj->pin].direction == PIN_OUTPUT) { - return ((NRF_GPIO->OUTSET & (1UL << obj->pin)) ? 1 : 0); + return (nrf_gpio_pin_out_read(obj->pin) ? 1 : 0); } else { return nrf_gpio_pin_read(obj->pin); } @@ -92,7 +109,7 @@ int gpio_read(gpio_t *obj) static void gpiote_pin_uninit(uint8_t pin) { - if (m_gpio_initialized & (1UL << pin)) { + if (m_gpio_initialized & ((gpio_mask_t)1UL << pin)) { if ((m_gpio_cfg[pin].direction == PIN_OUTPUT) && (!m_gpio_cfg[pin].used_as_irq)) { nrf_drv_gpiote_out_uninit(pin); } @@ -116,7 +133,7 @@ static void gpio_apply_config(uint8_t pin) if (m_gpio_cfg[pin].used_as_irq) { cfg.pull = NRF_GPIO_PIN_PULLUP; nrf_drv_gpiote_in_init(pin, &cfg, gpiote_irq_handler); - if ((m_gpio_irq_enabled & (1 << pin)) + if ((m_gpio_irq_enabled & ((gpio_mask_t)1 << pin)) && (m_gpio_cfg[pin].irq_rise || m_gpio_cfg[pin].irq_fall)) { nrf_drv_gpiote_in_event_enable(pin, true); @@ -142,17 +159,17 @@ static void gpio_apply_config(uint8_t pin) nrf_drv_gpiote_out_config_t cfg = GPIOTE_CONFIG_OUT_SIMPLE(m_gpio_cfg[pin].init_high); nrf_drv_gpiote_out_init(pin, &cfg); } - m_gpio_initialized |= (1UL << pin); + m_gpio_initialized |= ((gpio_mask_t)1UL << pin); } else { - m_gpio_initialized &= ~(1UL << pin); + m_gpio_initialized &= ~((gpio_mask_t)1UL << pin); } } void gpio_mode(gpio_t *obj, PinMode mode) { - MBED_ASSERT(obj->pin <= GPIO_PIN_COUNT); + MBED_ASSERT(obj->pin != (PinName)NC); gpiote_pin_uninit(obj->pin); // try to uninitialize gpio before a change. @@ -163,7 +180,7 @@ void gpio_mode(gpio_t *obj, PinMode mode) void gpio_dir(gpio_t *obj, PinDirection direction) { - MBED_ASSERT(obj->pin <= GPIO_PIN_COUNT); + MBED_ASSERT(obj->pin != (PinName)NC); gpiote_pin_uninit(obj->pin); // try to uninitialize gpio before a change. @@ -211,7 +228,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) { gpio_cfg_t* cfg = &m_gpio_cfg[obj->ch]; bool irq_enabled_before = - (m_gpio_irq_enabled & (1 << obj->ch)) && + (m_gpio_irq_enabled & ((gpio_mask_t)1 << obj->ch)) && (cfg->irq_rise || cfg->irq_fall); if (event == IRQ_RISE) { @@ -235,7 +252,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) void gpio_irq_enable(gpio_irq_t *obj) { - m_gpio_irq_enabled |= (1 << obj->ch); + m_gpio_irq_enabled |= ((gpio_mask_t)1 << obj->ch); if (m_gpio_cfg[obj->ch].irq_rise || m_gpio_cfg[obj->ch].irq_fall) { nrf_drv_gpiote_in_event_enable(obj->ch, true); } @@ -244,6 +261,6 @@ void gpio_irq_enable(gpio_irq_t *obj) void gpio_irq_disable(gpio_irq_t *obj) { - m_gpio_irq_enabled &= ~(1 << obj->ch); + m_gpio_irq_enabled &= ~((gpio_mask_t)1 << obj->ch); nrf_drv_gpiote_in_event_disable(obj->ch); } diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/i2c_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/i2c_api.c index 66063b4c499..723a406dd23 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/i2c_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/i2c_api.c @@ -45,7 +45,7 @@ #include "mbed_error.h" #include "nrf_twi.h" #include "nrf_drv_common.h" -#include "nrf_drv_config.h" +#include "sdk_config.h" #include "app_util_platform.h" #include "nrf_gpio.h" #include "nrf_delay.h" @@ -62,6 +62,11 @@ #endif #define TWI_INFO(obj) (&m_twi_info[TWI_IDX(obj)]) +#ifdef TARGET_SDK13 + #define TWI0_INSTANCE_INDEX 0 + #define TWI1_INSTANCE_INDEX TWI0_INSTANCE_INDEX+TWI0_ENABLED +#endif + typedef struct { bool initialized; uint32_t pselsda; @@ -98,22 +103,22 @@ void SPI1_TWI1_IRQHandler(void); static const peripheral_handler_desc_t twi_handlers[TWI_COUNT] = { - #if TWI0_ENABLED +#if TWI0_ENABLED { SPI0_TWI0_IRQn, (uint32_t) SPI0_TWI0_IRQHandler }, - #endif - #if TWI1_ENABLED +#endif +#if TWI1_ENABLED { SPI1_TWI1_IRQn, (uint32_t) SPI1_TWI1_IRQHandler } - #endif +#endif }; #ifdef NRF51 #define TWI_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW -#elif defined(NRF52) +#elif defined(NRF52) || defined(NRF52840_XXAA) #define TWI_IRQ_PRIORITY APP_IRQ_PRIORITY_LOWEST #endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/objects.h b/targets/TARGET_NORDIC/TARGET_NRF5/objects.h index 209134b7d15..4ae7530509f 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/objects.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/objects.h @@ -57,9 +57,6 @@ struct spi_s { }; struct port_s { - __IO uint32_t *reg_cnf; - __IO uint32_t *reg_out; - __I uint32_t *reg_in; PortName port; uint32_t mask; }; diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/pinmap.c b/targets/TARGET_NORDIC/TARGET_NRF5/pinmap.c index 989fbf209bc..f723a5837e1 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/pinmap.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/pinmap.c @@ -16,6 +16,7 @@ #include "mbed_assert.h" #include "mbed_error.h" #include "pinmap.h" +#include "nrf_gpio.h" void pin_function(PinName pin, int function) { @@ -29,7 +30,12 @@ void pin_mode(PinName pin, PinMode mode) MBED_ASSERT(pin != (PinName)NC); uint32_t pin_number = (uint32_t)pin; - - NRF_GPIO->PIN_CNF[pin_number] &= ~GPIO_PIN_CNF_PULL_Msk; - NRF_GPIO->PIN_CNF[pin_number] |= (mode << GPIO_PIN_CNF_PULL_Pos); + +#ifdef TARGET_SDK11 + NRF_GPIO_Type * reg = NRF_GPIO; +#else + NRF_GPIO_Type * reg = nrf_gpio_pin_port_decode(&pin_number); +#endif + reg->PIN_CNF[pin_number] &= ~GPIO_PIN_CNF_PULL_Msk; + reg->PIN_CNF[pin_number] |= (mode << GPIO_PIN_CNF_PULL_Pos); } diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/port_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/port_api.c index ad3be048166..e8c57184a5a 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/port_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/port_api.c @@ -38,23 +38,42 @@ #include "port_api.h" #include "pinmap.h" -#include "gpio_api.h" + +#if defined(TARGET_MCU_NRF51822) || defined(TARGET_MCU_NRF52832) + #define GPIO_REG_LIST {NRF_GPIO} +#endif + +static NRF_GPIO_Type * const m_ports[] = GPIO_REG_LIST; + +#if defined(TARGET_MCU_NRF51822) + static const uint32_t m_gpio_pin_count[] = {31}; +#elif defined(TARGET_MCU_NRF52832) + static const uint32_t m_gpio_pin_count[] = {32}; +#elif defined(TARGET_MCU_NRF52840) + static const uint32_t m_gpio_pin_count[] = {32, 16}; +#else + #error not recognized gpio count for mcu +#endif + +#define GPIO_PORT_COUNT (sizeof(m_gpio_pin_count)/sizeof(m_gpio_pin_count[0])) + PinName port_pin(PortName port, int pin_n) { - (void) port; - return (PinName)(pin_n); +#if defined(TARGET_MCU_NRF51822) || defined(TARGET_MCU_NRF52832) + return (PinName)pin_n; +#else + return (PinName)NRF_GPIO_PIN_MAP(port, pin_n); +#endif } void port_init(port_t *obj, PortName port, int mask, PinDirection dir) { + MBED_ASSERT((uint32_t)port < GPIO_PORT_COUNT); + obj->port = port; obj->mask = mask; - obj->reg_out = &NRF_GPIO->OUT; - obj->reg_in = &NRF_GPIO->IN; - obj->reg_cnf = NRF_GPIO->PIN_CNF; - port_dir(obj, dir); } @@ -71,38 +90,45 @@ void port_mode(port_t *obj, PinMode mode) void port_dir(port_t *obj, PinDirection dir) { - int i; + uint32_t i; + + volatile uint32_t *reg_cnf = (volatile uint32_t*) m_ports[obj->port]->PIN_CNF; + switch (dir) { - case PIN_INPUT: - for (i = 0; i<31; i++) { - if (obj->mask & (1 << i)) { - obj->reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) - | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) - | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) - | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos); + case PIN_INPUT: + + for (i = 0; i < m_gpio_pin_count[obj->port]; i++) { + if (obj->mask & (1 << i)) { + reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) + | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) + | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) + | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos); + } } - } - break; - case PIN_OUTPUT: - for (i = 0; i<31; i++) { - if (obj->mask & (1 << i)) { - obj->reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) - | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) - | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) - | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) - | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); + break; + + case PIN_OUTPUT: + + for (i = 0; i < m_gpio_pin_count[obj->port]; i++) { + if (obj->mask & (1 << i)) { + reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) + | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) + | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) + | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) + | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); + } } - } - break; + break; } } void port_write(port_t *obj, int value) { - *obj->reg_out = value; + m_ports[obj->port]->OUTSET = value & obj->mask; + m_ports[obj->port]->OUTCLR = (~value) & obj->mask; } int port_read(port_t *obj) { - return (*obj->reg_in); + return ((m_ports[obj->port]->IN) & obj->mask); } diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/copyright_header.txt b/targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/copyright_header.txt similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/copyright_header.txt rename to targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/copyright_header.txt diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/replace_headers.py b/targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/replace_headers.py similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/replace_headers.py rename to targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/replace_headers.py diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/sdk_update.py b/targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/sdk_update.py similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/sdk_update.py rename to targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/sdk_update.py diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/update_desc.json b/targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/update_desc.json similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/update_desc.json rename to targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/update_desc.json diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/pwmout_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/pwmout_api.c similarity index 99% rename from targets/TARGET_NORDIC/TARGET_NRF5_SDK13/pwmout_api.c rename to targets/TARGET_NORDIC/TARGET_NRF5/pwmout_api.c index 230ca3e9fe6..08e86a3d1e0 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/pwmout_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/pwmout_api.c @@ -35,12 +35,15 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - + +#ifndef TARGET_MCU_NRF51822 + #include "mbed_assert.h" #include "mbed_error.h" #include "pwmout_api.h" #include "cmsis.h" #include "pinmap.h" +#include "sdk_config.h" #if DEVICE_PWMOUT @@ -397,3 +400,5 @@ static void internal_pwmout_exe(pwmout_t *obj, bool new_period, bool initializat } #endif // DEVICE_PWMOUT + +#endif \ No newline at end of file diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c index 13ab6d3bb51..0835c517652 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c @@ -45,9 +45,9 @@ #include "mbed_error.h" #include "nrf_uart.h" #include "nrf_drv_common.h" -#include "nrf_drv_config.h" #include "app_util_platform.h" #include "nrf_gpio.h" +#include "sdk_config.h" #define UART_INSTANCE_COUNT 1 #define UART_INSTANCE NRF_UART0 @@ -56,8 +56,8 @@ #define UART_INSTANCE_ID 0 #define UART_CB uart_cb[UART_INSTANCE_ID] -#define UART_DEFAULT_BAUDRATE UART0_CONFIG_BAUDRATE -#define UART_DEFAULT_PARITY UART0_CONFIG_PARITY +#define UART_DEFAULT_BAUDRATE UART_DEFAULT_CONFIG_BAUDRATE +#define UART_DEFAULT_PARITY UART_DEFAULT_CONFIG_PARITY // expected the macro from mbed configuration system #ifndef MBED_CONF_NORDIC_UART_HWFC @@ -66,17 +66,17 @@ #endif #if MBED_CONF_NORDIC_UART_HWFC == 1 - #define UART_DEFAULT_HWFC UART0_CONFIG_HWFC + #define UART_DEFAULT_HWFC UART_DEFAULT_CONFIG_HWFC #else #define UART_DEFAULT_HWFC NRF_UART_HWFC_DISABLED #endif -#define UART_DEFAULT_CTS UART0_CONFIG_PSEL_CTS -#define UART_DEFAULT_RTS UART0_CONFIG_PSEL_RTS +#define UART_DEFAULT_CTS CTS_PIN_NUMBER +#define UART_DEFAULT_RTS RTS_PIN_NUMBER #ifdef NRF51 #define NRFx_MBED_UART_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW -#elif defined(NRF52) +#elif defined(NRF52) || defined(NRF52840_XXAA) #define NRFx_MBED_UART_IRQ_PRIORITY APP_IRQ_PRIORITY_LOWEST #endif @@ -556,7 +556,7 @@ static void internal_set_hwfc(FlowControl type, nrf_gpio_cfg_input(UART_CB.pselcts, NRF_GPIO_PIN_NOPULL); } - UART_CB.hwfc = (type == FlowControlNone)? NRF_UART_HWFC_DISABLED : UART0_CONFIG_HWFC; + UART_CB.hwfc = (nrf_uart_hwfc_t)((type == FlowControlNone)? NRF_UART_HWFC_DISABLED : UART_DEFAULT_CONFIG_HWFC); nrf_uart_configure(UART_INSTANCE, UART_CB.parity, UART_CB.hwfc); nrf_uart_hwfc_pins_set(UART_INSTANCE, UART_CB.pselrts, UART_CB.pselcts); diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c b/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c index 29020dc934a..f806e7a0a65 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c @@ -33,7 +33,7 @@ void hal_sleep(void) // the processor from disabled interrupts. SCB->SCR |= SCB_SCR_SEVONPEND_Msk; -#ifdef NRF52 +#if defined(NRF52) || defined(NRF52840_XXAA) /* Clear exceptions and PendingIRQ from the FPU unit */ __set_FPSCR(__get_FPSCR() & ~(FPU_EXCEPTION_MASK)); (void) __get_FPSCR(); @@ -41,7 +41,7 @@ void hal_sleep(void) #endif // If the SoftDevice is enabled, its API must be used to go to sleep. - if (softdevice_handler_isEnabled()) { + if (softdevice_handler_is_enabled()) { sd_power_mode_set(NRF_POWER_MODE_LOWPWR); sd_app_evt_wait(); } else { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c index 2c07af5e8b5..79b73d89fe3 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c @@ -48,6 +48,7 @@ #include "nrf_drv_spi.h" #include "nrf_drv_spis.h" #include "app_util_platform.h" +#include "sdk_config.h" #if DEVICE_SPI_ASYNCH #define SPI_IDX(obj) ((obj)->spi.spi_idx) @@ -186,7 +187,7 @@ static void slave_event_handler(uint8_t spi_idx, // And prepare for the next transfer. // Previous data set in 'spi_slave_write' (if any) has been transmitted, // now use the default one, until some new is set by 'spi_slave_write'. - p_spi_info->tx_buf = NRF_DRV_SPIS_DEFAULT_ORC; + p_spi_info->tx_buf = SPIS_DEFAULT_ORC; nrf_drv_spis_buffers_set(&m_instances[spi_idx].slave, (uint8_t const *)&p_spi_info->tx_buf, 1, (uint8_t *)&p_spi_info->rx_buf, 1); @@ -228,7 +229,7 @@ static void prepare_master_config(nrf_drv_spi_config_t *p_config, p_config->frequency = p_spi_info->frequency; p_config->mode = (nrf_drv_spi_mode_t)p_spi_info->spi_mode; - p_config->irq_priority = SPI1_CONFIG_IRQ_PRIORITY; + p_config->irq_priority = SPI_DEFAULT_CONFIG_IRQ_PRIORITY; p_config->orc = 0xFF; p_config->bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST; } @@ -242,9 +243,9 @@ static void prepare_slave_config(nrf_drv_spis_config_t *p_config, p_config->csn_pin = p_spi_info->ss_pin; p_config->mode = (nrf_drv_spis_mode_t)p_spi_info->spi_mode; - p_config->irq_priority = SPIS1_CONFIG_IRQ_PRIORITY; - p_config->orc = NRF_DRV_SPIS_DEFAULT_ORC; - p_config->def = NRF_DRV_SPIS_DEFAULT_DEF; + p_config->irq_priority = SPIS_DEFAULT_CONFIG_IRQ_PRIORITY; + p_config->orc = SPIS_DEFAULT_ORC; + p_config->def = SPIS_DEFAULT_DEF; p_config->bit_order = NRF_DRV_SPIS_BIT_ORDER_MSB_FIRST; p_config->csn_pullup = NRF_DRV_SPIS_DEFAULT_CSN_PULLUP; p_config->miso_drive = NRF_DRV_SPIS_DEFAULT_MISO_DRIVE; @@ -379,7 +380,7 @@ void spi_format(spi_t *obj, int bits, int mode, int slave) m_slave_event_handlers[SPI_IDX(obj)]); // Prepare the slave for transfer. - p_spi_info->tx_buf = NRF_DRV_SPIS_DEFAULT_ORC; + p_spi_info->tx_buf = SPIS_DEFAULT_ORC; nrf_drv_spis_buffers_set(SLAVE_INST(obj), (uint8_t const *)&p_spi_info->tx_buf, 1, (uint8_t *)&p_spi_info->rx_buf, 1); diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c index 84bf8022a3a..bde1be74734 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c @@ -40,10 +40,12 @@ #include "common_rtc.h" #include "app_util.h" #include "nrf_drv_common.h" -#include "nrf_drv_config.h" #include "lp_ticker_api.h" #include "mbed_critical.h" +#if defined(NRF52_ERRATA_20) + #include "softdevice_handler.h" +#endif //------------------------------------------------------------------------------ // Common stuff used also by lp_ticker and rtc_api (see "common_rtc.h"). @@ -82,7 +84,23 @@ void COMMON_RTC_IRQ_HANDLER(void) lp_ticker_irq_handler(); } #endif +} +// Function for fix errata 20: RTC Register values are invalid +__STATIC_INLINE void errata_20(void) +{ +#if defined(NRF52_ERRATA_20) + if (!softdevice_handler_is_enabled()) + { + NRF_CLOCK->EVENTS_LFCLKSTARTED = 0; + NRF_CLOCK->TASKS_LFCLKSTART = 1; + + while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) + { + } + } + NRF_RTC1->TASKS_STOP = 0; +#endif } #if (defined (__ICCARM__)) && defined(TARGET_MCU_NRF51822)//IAR @@ -96,6 +114,8 @@ void common_rtc_init(void) return; } + errata_20(); + NVIC_SetVector(RTC1_IRQn, (uint32_t)RTC1_IRQHandler); // RTC is driven by the low frequency (32.768 kHz) clock, a proper request @@ -118,9 +138,9 @@ void common_rtc_init(void) // events will be enabled or disabled as needed (such approach is more // energy efficient). nrf_rtc_int_enable(COMMON_RTC_INSTANCE, - #if DEVICE_LOWPOWERTIMER +#if DEVICE_LOWPOWERTIMER LP_TICKER_INT_MASK | - #endif +#endif US_TICKER_INT_MASK | NRF_RTC_INT_OVERFLOW_MASK); @@ -129,18 +149,18 @@ void common_rtc_init(void) nrf_rtc_event_enable(COMMON_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); // All other relevant events are initially disabled. nrf_rtc_event_disable(COMMON_RTC_INSTANCE, - #if defined(TARGET_MCU_NRF51822) +#if defined(TARGET_MCU_NRF51822) OS_TICK_INT_MASK | - #endif - #if DEVICE_LOWPOWERTIMER +#endif +#if DEVICE_LOWPOWERTIMER LP_TICKER_INT_MASK | - #endif +#endif US_TICKER_INT_MASK); nrf_drv_common_irq_enable(nrf_drv_get_IRQn(COMMON_RTC_INSTANCE), #ifdef NRF51 APP_IRQ_PRIORITY_LOW -#elif defined(NRF52) +#elif defined(NRF52) || defined(NRF52840_XXAA) APP_IRQ_PRIORITY_LOWEST #endif ); @@ -291,7 +311,9 @@ static uint32_t previous_tick_cc_value = 0; */ MBED_WEAK uint32_t const os_trv; MBED_WEAK uint32_t const os_clockrate; -MBED_WEAK void OS_Tick_Handler() { } +MBED_WEAK void OS_Tick_Handler(void) +{ +} #if defined (__CC_ARM) /* ARMCC Compiler */ @@ -432,7 +454,8 @@ __stackless __task void COMMON_RTC_IRQ_HANDLER(void) * Return the next number of clock cycle needed for the next tick. * @note This function has been carrefuly optimized for a systick occuring every 1000us. */ -static uint32_t get_next_tick_cc_delta() { +static uint32_t get_next_tick_cc_delta() +{ uint32_t delta = 0; if (os_clockrate != 1000) { @@ -468,7 +491,8 @@ static uint32_t get_next_tick_cc_delta() { return delta; } -static inline void clear_tick_interrupt() { +static inline void clear_tick_interrupt() +{ nrf_rtc_event_clear(COMMON_RTC_INSTANCE, OS_TICK_EVENT); nrf_rtc_event_disable(COMMON_RTC_INSTANCE, OS_TICK_INT_MASK); } @@ -480,7 +504,8 @@ static inline void clear_tick_interrupt() { * @param val value to check * @return true if the value is included in the range and false otherwise. */ -static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t val) { +static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t val) +{ // regular case, begin < end // return true if begin <= val < end if (begin < end) { @@ -504,7 +529,8 @@ static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t va /** * Register the next tick. */ -static void register_next_tick() { +static void register_next_tick() +{ previous_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL); uint32_t delta = get_next_tick_cc_delta(); uint32_t new_compare_value = (previous_tick_cc_value + delta) & MAX_RTC_COUNTER_VAL; @@ -563,8 +589,9 @@ void os_tick_irqack(void) * @note This function is exposed by RTX kernel. * @return 1 if the timer has overflowed and 0 otherwise. */ -uint32_t os_tick_ovf(void) { - uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); +uint32_t os_tick_ovf(void) +{ + uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); uint32_t next_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL); return is_in_wrapped_range(previous_tick_cc_value, next_tick_cc_value, current_counter) ? 0 : 1; @@ -579,8 +606,9 @@ uint32_t os_tick_ovf(void) { * descending order, even if the internal counter used is an ascending one. * @return the value of the alternative hardware timer. */ -uint32_t os_tick_val(void) { - uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); +uint32_t os_tick_val(void) +{ + uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); uint32_t next_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL); // do not use os_tick_ovf because its counter value can be different diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/LF_Clock_config.md b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/LF_Clock_config.md deleted file mode 100644 index 22852ae261a..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/LF_Clock_config.md +++ /dev/null @@ -1,97 +0,0 @@ - -# LF Clock configuration using mbed configuration system - -In order to provide the configuration for a low frequency (LF) clock, add a description of the LF clock inside a mbed configuration JSON file. -For example at application level the description might be added in a mbed_app.json file and on target level the description might be added in the hal/target.json file. -LF clock source configuration is used for MCU startup initialization and the BLE SoftDevice LF clock configuration (if BLE libraries is used). Advanced configurations are used only for the BLE SoftDevice LF clock configuration. - - -## Usage: - -1. Clock source - -Default clock source is XTAL oscillator. It is defined at the target level configuration as the target.lf_clock_src key. -There are three options that can be configured as the clock source: - - NRF_LF_SRC_XTAL - - NRF_LF_SRC_RC - - NRF_LF_SRC_SYNTH - -In order to override this configuration use targed_override section in configuration file (e.g mbed_app.json) - -```json -{ - "target_overrides": { - "*": { - "target.lf_clock_src": "NRF_LF_SRC_XTAL" - } - } -} -``` - -2a. Advanced configuration of the LFCLK RC oscillator: - -```json -{ - "config": { - "lf_clock_rc_calib_timer_interval": { - "value": 16, - "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL" - }, - "lf_clock_rc_calib_mode_config": { - "value": 1, - "macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG" - } - } -} - -``` - -"lf_clock_rc_calib_timer_interval" - Calibration timer interval in 250 ms. It is equivalent to nrf_clock_lf_cfg_t::rc_ctiv. -This item generates macro MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL. -By default, such configuration is set to 16. - -"lf_clock_rc_calib_mode_config" - This value configures how often the RC oscillator will be calibrated, in number of calibration intervals. -It is equivalent to nrf_clock_lf_cfg_t::rc_temp_ctiv. -For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v2.0.0/structnrf__clock__lf__cfg__t.html) -This item generates macro MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG. -By default, such configuration is set to 1. - -2b. Advanced configuration of the LFCLK XTAL oscillator: - -Accuracy of the clock source can be set. In order to do so macro MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY should been provided (e.g. in mbed_app.json). -By default such configuration is set to NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM. -For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v2.0.0%2Fgroup___n_r_f___s_d_m___d_e_f_i_n_e_s.html) - -```json -{ - "config": { - "lf_clock_xtal_accuracy": { - "value": "NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM", - "macro_name": "MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY" - } - } -} - -``` - - - -2c. Advance configuration of the LFCLK Synthesized from HFCLK: - -Accuracy of the clock source can be set. In order to do so macro MBED_CONF_NORDIC_LF_CLOCK_SYNTH_ACCURACY should been provided (e.g. in mbed_app.json). -By default, such configuration is set to NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM. -For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v2.0.0%2Fgroup___n_r_f___s_d_m___d_e_f_i_n_e_s.html) - -```json -{ - "config": { - "lf_clock_synth_accuracy": { - "value": "NRF_CLOCK_LF_SYNTH_ACCURACY_250_PPM", - "macro_name": "MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY" - } - } -} - -``` - - diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/common_rtc.h b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/common_rtc.h deleted file mode 100644 index f15ff83a589..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/common_rtc.h +++ /dev/null @@ -1,57 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2015 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef COMMON_RTC_H -#define COMMON_RTC_H - -#include "nrf_rtc.h" - -#define RTC_COUNTER_BITS 24u - -// Instance 0 is reserved for SoftDevice. -// Instance 1 is used as a common one for us_ticker, lp_ticker and (in case -// of NRF51) as an alternative tick source for RTOS. -// ["us_ticker.c" uses hard coded addresses of the 'NRF_RTC1->EVENT_COMPARE[1]' -// register in inline assembly implementations of COMMON_RTC_IRQ_HANDLER, -// please remember to update those in case of doing changes here] -#define COMMON_RTC_INSTANCE NRF_RTC1 -#define COMMON_RTC_IRQ_HANDLER RTC1_IRQHandler -#define US_TICKER_CC_CHANNEL 0 -#define OS_TICK_CC_CHANNEL 1 -#define LP_TICKER_CC_CHANNEL 2 - -#define COMMON_RTC_EVENT_COMPARE(channel) \ - CONCAT_2(NRF_RTC_EVENT_COMPARE_, channel) -#define COMMON_RTC_INT_COMPARE_MASK(channel) \ - CONCAT_3(NRF_RTC_INT_COMPARE, channel, _MASK) - -#define US_TICKER_EVENT COMMON_RTC_EVENT_COMPARE(US_TICKER_CC_CHANNEL) -#define US_TICKER_INT_MASK COMMON_RTC_INT_COMPARE_MASK(US_TICKER_CC_CHANNEL) -#define OS_TICK_EVENT COMMON_RTC_EVENT_COMPARE(OS_TICK_CC_CHANNEL) -#define OS_TICK_INT_MASK COMMON_RTC_INT_COMPARE_MASK(OS_TICK_CC_CHANNEL) -#define LP_TICKER_EVENT COMMON_RTC_EVENT_COMPARE(LP_TICKER_CC_CHANNEL) -#define LP_TICKER_INT_MASK COMMON_RTC_INT_COMPARE_MASK(LP_TICKER_CC_CHANNEL) - -extern bool m_common_rtc_enabled; -extern uint32_t volatile m_common_rtc_overflows; - -void common_rtc_init(void); -uint32_t common_rtc_32bit_ticks_get(void); -uint64_t common_rtc_64bit_us_get(void); -void common_rtc_set_interrupt(uint32_t us_timestamp, uint32_t cc_channel, - uint32_t int_mask); - -#endif // COMMON_RTC_H diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/gpio_api.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/gpio_api.c deleted file mode 100644 index 4931b5330e8..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/gpio_api.c +++ /dev/null @@ -1,283 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "mbed_assert.h" -#include "gpio_api.h" -#include "gpio_irq_api.h" -#include "pinmap.h" -#include "nrf_drv_gpiote.h" - -#if defined(TARGET_MCU_NRF51822) - #define GPIO_PIN_COUNT 31 -#elif defined(TARGET_MCU_NRF52832) - #define GPIO_PIN_COUNT 32 -#elif defined(TARGET_MCU_NRF52840) - #define GPIO_PIN_COUNT 48 -#else - #error not recognized gpio count for mcu -#endif - -typedef struct -{ - bool used_as_gpio : 1; - PinDirection direction : 1; - bool init_high : 1; - PinMode pull : 2; - bool used_as_irq : 1; - bool irq_fall : 1; - bool irq_rise : 1; -} gpio_cfg_t; - -#if GPIO_PIN_COUNT > 32 - typedef uint64_t gpio_mask_t; -#else - typedef uint32_t gpio_mask_t; -#endif - -static gpio_mask_t m_gpio_initialized; -static gpio_cfg_t m_gpio_cfg[GPIO_PIN_COUNT]; - - -/*********** - GPIO IRQ -***********/ - -static gpio_irq_handler m_irq_handler; -static uint32_t m_channel_ids[GPIO_PIN_COUNT] = {0}; -static gpio_mask_t m_gpio_irq_enabled; - - -static void gpiote_irq_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) -{ - nrf_gpio_pin_sense_t sense = nrf_gpio_pin_sense_get(pin); - gpio_irq_event event = (sense == NRF_GPIO_PIN_SENSE_LOW) ? IRQ_RISE : IRQ_FALL; - - if (m_gpio_irq_enabled & ((gpio_mask_t)1 << pin)) - { - if (((event == IRQ_RISE) && m_gpio_cfg[pin].irq_rise) - || ((event == IRQ_FALL) && m_gpio_cfg[pin].irq_fall)) - { - m_irq_handler(m_channel_ids[pin], event); - } - } -} - -void GPIOTE_IRQHandler(void);// exported from nrf_drv_gpiote.c - -void gpio_init(gpio_t *obj, PinName pin) -{ - obj->pin = pin; - if (pin == (PinName)NC) - { - return; - } - MBED_ASSERT((uint32_t)pin < GPIO_PIN_COUNT); - - NVIC_SetVector(GPIOTE_IRQn, (uint32_t) GPIOTE_IRQHandler); - - (void) nrf_drv_gpiote_init(); - - m_gpio_cfg[obj->pin].used_as_gpio = true; -} - - -int gpio_read(gpio_t *obj) -{ - MBED_ASSERT(obj->pin != (PinName)NC); - if (m_gpio_cfg[obj->pin].direction == PIN_OUTPUT) - { - return (nrf_gpio_pin_out_read(obj->pin) ? 1 : 0); - } - else - { - return nrf_gpio_pin_read(obj->pin); - } -} - -static void gpiote_pin_uninit(uint8_t pin) -{ - if (m_gpio_initialized & ((gpio_mask_t)1 << pin)) - { - if ((m_gpio_cfg[pin].direction == PIN_OUTPUT) && (!m_gpio_cfg[pin].used_as_irq)) - { - nrf_drv_gpiote_out_uninit(pin); - } - else - { - nrf_drv_gpiote_in_uninit(pin); - } - } -} - -static void gpio_apply_config(uint8_t pin) -{ - if (m_gpio_cfg[pin].used_as_gpio || m_gpio_cfg[pin].used_as_irq) - { - if ((m_gpio_cfg[pin].direction == PIN_INPUT) - || (m_gpio_cfg[pin].used_as_irq)) - { - //Configure as input. - nrf_drv_gpiote_in_config_t cfg; - - cfg.hi_accuracy = false; - cfg.is_watcher = false; - cfg.sense = NRF_GPIOTE_POLARITY_TOGGLE; - if (m_gpio_cfg[pin].used_as_irq) - { - cfg.pull = NRF_GPIO_PIN_PULLUP; - nrf_drv_gpiote_in_init(pin, &cfg, gpiote_irq_handler); - if ((m_gpio_irq_enabled & ((gpio_mask_t)1 << pin)) - && (m_gpio_cfg[pin].irq_rise || m_gpio_cfg[pin].irq_fall)) - { - nrf_drv_gpiote_in_event_enable(pin, true); - } - } - else - { - switch (m_gpio_cfg[pin].pull) - { - case PullUp: - cfg.pull = NRF_GPIO_PIN_PULLUP; - break; - case PullDown: - cfg.pull = NRF_GPIO_PIN_PULLDOWN; - break; - default: - cfg.pull = NRF_GPIO_PIN_NOPULL; - break; - } - nrf_drv_gpiote_in_init(pin, &cfg, NULL); - } - } - else - { - // Configure as output. - nrf_drv_gpiote_out_config_t cfg = GPIOTE_CONFIG_OUT_SIMPLE(m_gpio_cfg[pin].init_high); - nrf_drv_gpiote_out_init(pin, &cfg); - } - m_gpio_initialized |= ((gpio_mask_t)1 << pin); - } - else - { - m_gpio_initialized &= ~((gpio_mask_t)1 << pin); - } -} - - -void gpio_mode(gpio_t *obj, PinMode mode) -{ - MBED_ASSERT(obj->pin != (PinName)NC); - - gpiote_pin_uninit(obj->pin); // try to uninitialize gpio before a change. - - m_gpio_cfg[obj->pin].pull = mode; - gpio_apply_config(obj->pin); -} - - -void gpio_dir(gpio_t *obj, PinDirection direction) -{ - MBED_ASSERT(obj->pin != (PinName)NC); - - gpiote_pin_uninit(obj->pin); // try to uninitialize gpio before a change. - - m_gpio_cfg[obj->pin].direction = direction; - gpio_apply_config(obj->pin); -} - - -/*********** - GPIO IRQ -***********/ - -int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id) -{ - if (pin == NC) - { - return -1; - } - MBED_ASSERT((uint32_t)pin < GPIO_PIN_COUNT); - (void) nrf_drv_gpiote_init(); - - gpiote_pin_uninit(pin); // try to uninitialize gpio before a change. - - m_gpio_cfg[pin].used_as_irq = true; - m_channel_ids[pin] = id; - obj->ch = pin; - m_irq_handler = handler; - m_channel_ids[pin] = id; - - gpio_apply_config(pin); - return 1; -} - - -void gpio_irq_free(gpio_irq_t *obj) -{ - nrf_drv_gpiote_in_uninit(obj->ch); - m_gpio_cfg[obj->ch].used_as_irq = false; - m_channel_ids[obj->ch] = 0; - - gpio_apply_config(obj->ch); -} - - -void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) -{ - gpio_cfg_t* cfg = &m_gpio_cfg[obj->ch]; - bool irq_enabled_before = - (m_gpio_irq_enabled & ((gpio_mask_t)1 << obj->ch)) && - (cfg->irq_rise || cfg->irq_fall); - - if (event == IRQ_RISE) - { - cfg->irq_rise = enable ? true : false; - } - else if (event == IRQ_FALL) - { - cfg->irq_fall = enable ? true : false; - } - - bool irq_enabled_after = cfg->irq_rise || cfg->irq_fall; - - if (irq_enabled_before != irq_enabled_after) - { - if (irq_enabled_after) - { - gpio_irq_enable(obj); - } - else - { - gpio_irq_disable(obj); - } - } -} - - -void gpio_irq_enable(gpio_irq_t *obj) -{ - m_gpio_irq_enabled |= ((gpio_mask_t)1 << obj->ch); - if (m_gpio_cfg[obj->ch].irq_rise || m_gpio_cfg[obj->ch].irq_fall) - { - nrf_drv_gpiote_in_event_enable(obj->ch, true); - } -} - - -void gpio_irq_disable(gpio_irq_t *obj) -{ - m_gpio_irq_enabled &= ~((gpio_mask_t)1 << obj->ch); - nrf_drv_gpiote_in_event_disable(obj->ch); -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/gpio_object.h b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/gpio_object.h deleted file mode 100644 index 9a6db55284d..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/gpio_object.h +++ /dev/null @@ -1,54 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef MBED_GPIO_OBJECT_H -#define MBED_GPIO_OBJECT_H - -#include "mbed_assert.h" - -#include "nrf_gpio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct -{ - PinName pin; -} gpio_t; - -static inline void gpio_write(gpio_t *obj, int value) -{ - MBED_ASSERT(obj->pin != (PinName)NC); - if (value) - { - nrf_gpio_pin_set(obj->pin); - } - else - { - nrf_gpio_pin_clear(obj->pin); - } -} - -static inline int gpio_is_connected(const gpio_t *obj) -{ - return obj->pin != (PinName)NC; -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/i2c_api.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/i2c_api.c deleted file mode 100644 index 69a94770baf..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/i2c_api.c +++ /dev/null @@ -1,784 +0,0 @@ -/* - * Copyright (c) 2017 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - - -#include "i2c_api.h" - -#if DEVICE_I2C - -#include "mbed_assert.h" -#include "mbed_error.h" -#include "nrf_twi.h" -#include "nrf_drv_common.h" -#include "sdk_config.h" -#include "app_util_platform.h" -#include "nrf_gpio.h" -#include "nrf_delay.h" - -// An arbitrary value used as the counter in loops waiting for given event -// (e.g. STOPPED), needed to avoid infinite loops (and not involve any timers -// or tickers). -#define TIMEOUT_VALUE 1000 - -#if DEVICE_I2C_ASYNCH - #define TWI_IDX(obj) ((obj)->i2c.twi_idx) -#else - #define TWI_IDX(obj) ((obj)->twi_idx) -#endif -#define TWI_INFO(obj) (&m_twi_info[TWI_IDX(obj)]) - -#define TWI0_INSTANCE_INDEX 0 -#define TWI1_INSTANCE_INDEX TWI0_INSTANCE_INDEX+TWI0_ENABLED - -typedef struct { - bool initialized; - uint32_t pselsda; - uint32_t pselscl; - nrf_twi_frequency_t frequency; - bool start_twi; - -#if DEVICE_I2C_ASYNCH - volatile bool active; - uint8_t const *tx; - size_t tx_length; - uint8_t *rx; - size_t rx_length; - bool stop; - - volatile uint32_t events; - void (*handler)(void); - uint32_t evt_mask; -#endif // DEVICE_I2C_ASYNCH -} twi_info_t; -static twi_info_t m_twi_info[TWI_COUNT]; - -static NRF_TWI_Type * const m_twi_instances[TWI_COUNT] = { -#if TWI0_ENABLED - NRF_TWI0, -#endif -#if TWI1_ENABLED - NRF_TWI1, -#endif -}; - -void SPI0_TWI0_IRQHandler(void); -void SPI1_TWI1_IRQHandler(void); - -static const peripheral_handler_desc_t twi_handlers[TWI_COUNT] = -{ -#if TWI0_ENABLED - { - SPI0_TWI0_IRQn, - (uint32_t) SPI0_TWI0_IRQHandler - }, -#endif -#if TWI1_ENABLED - { - SPI1_TWI1_IRQn, - (uint32_t) SPI1_TWI1_IRQHandler - } -#endif -}; -#ifdef NRF51 - #define TWI_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW -#elif defined(NRF52) || defined(NRF52840_XXAA) - #define TWI_IRQ_PRIORITY APP_IRQ_PRIORITY_LOWEST -#endif - - -#if DEVICE_I2C_ASYNCH -static void start_asynch_rx(twi_info_t *twi_info, NRF_TWI_Type *twi) -{ - if (twi_info->rx_length == 1 && twi_info->stop) - { - nrf_twi_shorts_set(twi, NRF_TWI_SHORT_BB_STOP_MASK); - } - else - { - nrf_twi_shorts_set(twi, NRF_TWI_SHORT_BB_SUSPEND_MASK); - } - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STARTRX); -} - -static void twi_irq_handler(uint8_t instance_idx) -{ - twi_info_t *twi_info = &m_twi_info[instance_idx]; - - NRF_TWI_Type *twi = m_twi_instances[instance_idx]; - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_ERROR)) - { - nrf_twi_event_clear(twi, NRF_TWI_EVENT_ERROR); - - // In case of an error, force STOP. - // The current transfer may be suspended (if it is RX), so it must be - // resumed before the STOP task is triggered. - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STOP); - - uint32_t errorsrc = nrf_twi_errorsrc_get_and_clear(twi); - twi_info->events |= I2C_EVENT_ERROR; - if (errorsrc & NRF_TWI_ERROR_ADDRESS_NACK) - { - twi_info->events |= I2C_EVENT_ERROR_NO_SLAVE; - } - if (errorsrc & NRF_TWI_ERROR_DATA_NACK) - { - twi_info->events |= I2C_EVENT_TRANSFER_EARLY_NACK; - } - } - - bool finished = false; - - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_TXDSENT)) - { - nrf_twi_event_clear(twi, NRF_TWI_EVENT_TXDSENT); - - MBED_ASSERT(twi_info->tx_length > 0); - --(twi_info->tx_length); - // Send next byte if there is still something to be sent. - if (twi_info->tx_length > 0) - { - nrf_twi_txd_set(twi, *(twi_info->tx)); - ++(twi_info->tx); - // It TX is done, start RX if requested. - } - else if (twi_info->rx_length > 0) - { - start_asynch_rx(twi_info, twi); - // If there is nothing more to do, finalize the transfer. - } - else - { - if (twi_info->stop) - { - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STOP); - } - else - { - nrf_twi_task_trigger(twi, NRF_TWI_TASK_SUSPEND); - finished = true; - } - twi_info->events |= I2C_EVENT_TRANSFER_COMPLETE; - } - } - - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_RXDREADY)) - { - nrf_twi_event_clear(twi, NRF_TWI_EVENT_RXDREADY); - - MBED_ASSERT(twi_info->rx_length > 0); - *(twi_info->rx) = nrf_twi_rxd_get(twi); - ++(twi_info->rx); - --(twi_info->rx_length); - - if (twi_info->rx_length > 0) - { - // If more bytes should be received, resume the transfer - // (in case the stop condition should be generated after the next - // byte, change the shortcuts configuration first). - if (twi_info->rx_length == 1 && twi_info->stop) - { - nrf_twi_shorts_set(twi, NRF_TWI_SHORT_BB_STOP_MASK); - } - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - } - else - { - // If all requested bytes were received, finalize the transfer. - finished = true; - twi_info->events |= I2C_EVENT_TRANSFER_COMPLETE; - } - } - - if (finished || - nrf_twi_event_check(twi, NRF_TWI_EVENT_STOPPED) || - (nrf_twi_int_enable_check(twi, NRF_TWI_INT_SUSPENDED_MASK) && - nrf_twi_event_check(twi, NRF_TWI_EVENT_SUSPENDED))) - { - // There is no need to clear the STOPPED and SUSPENDED events here, - // they will no longer generate the interrupt - see below. - - nrf_twi_shorts_set(twi, 0); - // Disable all interrupt sources. - nrf_twi_int_disable(twi, UINT32_MAX); - twi_info->active = false; - - if (twi_info->handler) - { - twi_info->handler(); - } - } -} - -#if TWI0_ENABLED -static void irq_handler_twi0(void) -{ - twi_irq_handler(TWI0_INSTANCE_INDEX); -} -#endif -#if TWI1_ENABLED -static void irq_handler_twi1(void) -{ - twi_irq_handler(TWI1_INSTANCE_INDEX); -} -#endif -static nrf_drv_irq_handler_t const m_twi_irq_handlers[TWI_COUNT] = -{ -#if TWI0_ENABLED - irq_handler_twi0, -#endif -#if TWI1_ENABLED - irq_handler_twi1, -#endif -}; -#endif // DEVICE_I2C_ASYNCH - - -static void configure_twi_pin(uint32_t pin, nrf_gpio_pin_dir_t dir) -{ - nrf_gpio_cfg(pin, - dir, - NRF_GPIO_PIN_INPUT_CONNECT, - NRF_GPIO_PIN_PULLUP, - NRF_GPIO_PIN_S0D1, - NRF_GPIO_PIN_NOSENSE); -} - -static void twi_clear_bus(twi_info_t *twi_info) -{ - // Try to set SDA high, and check if no slave tries to drive it low. - nrf_gpio_pin_set(twi_info->pselsda); - configure_twi_pin(twi_info->pselsda, NRF_GPIO_PIN_DIR_OUTPUT); - // In case SDA is low, make up to 9 cycles on SCL line to help the slave - // that pulls SDA low release it. - if (!nrf_gpio_pin_read(twi_info->pselsda)) - { - nrf_gpio_pin_set(twi_info->pselscl); - configure_twi_pin(twi_info->pselscl, NRF_GPIO_PIN_DIR_OUTPUT); - nrf_delay_us(4); - - for (int i = 0; i < 9; i++) - { - if (nrf_gpio_pin_read(twi_info->pselsda)) - { - break; - } - nrf_gpio_pin_clear(twi_info->pselscl); - nrf_delay_us(4); - nrf_gpio_pin_set(twi_info->pselscl); - nrf_delay_us(4); - } - - // Finally, generate STOP condition to put the bus into initial state. - nrf_gpio_pin_clear(twi_info->pselsda); - nrf_delay_us(4); - nrf_gpio_pin_set(twi_info->pselsda); - } -} - -void i2c_init(i2c_t *obj, PinName sda, PinName scl) -{ - int i; - - for (i = 0; i < TWI_COUNT; ++i) - { - if (m_twi_info[i].initialized && - m_twi_info[i].pselsda == (uint32_t)sda && - m_twi_info[i].pselscl == (uint32_t)scl) - { - TWI_IDX(obj) = i; - TWI_INFO(obj)->frequency = NRF_TWI_FREQ_100K; - i2c_reset(obj); - return; - } - } - - for (i = 0; i < TWI_COUNT; ++i) - { - if (!m_twi_info[i].initialized) - { - TWI_IDX(obj) = i; - - twi_info_t *twi_info = TWI_INFO(obj); - twi_info->initialized = true; - twi_info->pselsda = (uint32_t)sda; - twi_info->pselscl = (uint32_t)scl; - twi_info->frequency = NRF_TWI_FREQ_100K; - twi_info->start_twi = false; -#if DEVICE_I2C_ASYNCH - twi_info->active = false; -#endif - - twi_clear_bus(twi_info); - - configure_twi_pin(twi_info->pselsda, NRF_GPIO_PIN_DIR_INPUT); - configure_twi_pin(twi_info->pselscl, NRF_GPIO_PIN_DIR_INPUT); - - i2c_reset(obj); - -#if DEVICE_I2C_ASYNCH - nrf_drv_common_per_res_acquire(m_twi_instances[i], - m_twi_irq_handlers[i]); - NVIC_SetVector(twi_handlers[i].IRQn, twi_handlers[i].vector); - nrf_drv_common_irq_enable(twi_handlers[i].IRQn, TWI_IRQ_PRIORITY); -#endif - - return; - } - } - - error("No available I2C peripheral\r\n"); -} - -void i2c_reset(i2c_t *obj) -{ - twi_info_t *twi_info = TWI_INFO(obj); - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - - nrf_twi_disable(twi); - nrf_twi_pins_set(twi, twi_info->pselscl, twi_info->pselsda); - nrf_twi_frequency_set(twi, twi_info->frequency); - nrf_twi_enable(twi); -} - -int i2c_start(i2c_t *obj) -{ - twi_info_t *twi_info = TWI_INFO(obj); -#if DEVICE_I2C_ASYNCH - if (twi_info->active) - { - return I2C_ERROR_BUS_BUSY; - } -#endif - twi_info->start_twi = true; - - return 0; -} - -int i2c_stop(i2c_t *obj) -{ - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - - // The current transfer may be suspended (if it is RX), so it must be - // resumed before the STOP task is triggered. - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STOP); - uint32_t remaining_time = TIMEOUT_VALUE; - - do - { - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_STOPPED)) - { - return 0; - } - } - while (--remaining_time); - - return 1; -} - -void i2c_frequency(i2c_t *obj, int hz) -{ - twi_info_t *twi_info = TWI_INFO(obj); - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - - if (hz < 250000) - { - twi_info->frequency = NRF_TWI_FREQ_100K; - } - else if (hz < 400000) - { - twi_info->frequency = NRF_TWI_FREQ_250K; - } - else - { - twi_info->frequency = NRF_TWI_FREQ_400K; - } - nrf_twi_frequency_set(twi, twi_info->frequency); -} - -static uint8_t twi_address(int i2c_address) -{ - // The TWI peripheral requires 7-bit slave address (without R/W bit). - return (i2c_address >> 1); -} - -static void start_twi_read(NRF_TWI_Type *twi, int address) -{ - nrf_twi_event_clear(twi, NRF_TWI_EVENT_STOPPED); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_RXDREADY); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_ERROR); - (void)nrf_twi_errorsrc_get_and_clear(twi); - - nrf_twi_shorts_set(twi, NRF_TWI_SHORT_BB_SUSPEND_MASK); - - nrf_twi_address_set(twi, twi_address(address)); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STARTRX); -} - -int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) -{ - // Zero-length RX transfers are not supported. Such transfers cannot - // be easily achieved with TWI peripheral (some dirty tricks would be - // required for this), and they are actually useless (TX can be used - // to check if the address is acknowledged by a slave). - MBED_ASSERT(length > 0); - - twi_info_t *twi_info = TWI_INFO(obj); -#if DEVICE_I2C_ASYNCH - if (twi_info->active) - { - return I2C_ERROR_BUS_BUSY; - } -#endif - twi_info->start_twi = false; - - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - start_twi_read(twi, address); - - int result = length; - - while (length > 0) - { - int byte_read_result = i2c_byte_read(obj, (stop && length == 1)); - if (byte_read_result < 0) - { - // When an error occurs, return the number of bytes that have been - // received successfully. - result -= length; - // Force STOP condition. - stop = 1; - break; - } - *data++ = (uint8_t)byte_read_result; - --length; - } - - if (stop) - { - (void)i2c_stop(obj); - } - - return result; -} - -static uint8_t twi_byte_write(NRF_TWI_Type *twi, uint8_t data) -{ - nrf_twi_event_clear(twi, NRF_TWI_EVENT_TXDSENT); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_ERROR); - - nrf_twi_txd_set(twi, data); - uint32_t remaining_time = TIMEOUT_VALUE; - - do - { - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_TXDSENT)) - { - nrf_twi_event_clear(twi, NRF_TWI_EVENT_TXDSENT); - return 1; // ACK received - } - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_ERROR)) - { - nrf_twi_event_clear(twi, NRF_TWI_EVENT_ERROR); - return 0; // some error occurred - } - } - while (--remaining_time); - - return 2; // timeout; -} - -static void start_twi_write(NRF_TWI_Type *twi, int address) -{ - nrf_twi_event_clear(twi, NRF_TWI_EVENT_STOPPED); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_TXDSENT); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_ERROR); - (void)nrf_twi_errorsrc_get_and_clear(twi); - - nrf_twi_shorts_set(twi, 0); - - nrf_twi_address_set(twi, twi_address(address)); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STARTTX); -} - -int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) -{ - twi_info_t *twi_info = TWI_INFO(obj); -#if DEVICE_I2C_ASYNCH - if (twi_info->active) - { - return I2C_ERROR_BUS_BUSY; - } -#endif - twi_info->start_twi = false; - - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - start_twi_write(twi, address); - - // Special case - transaction with no data. - // It can be used to check if a slave acknowledges the address. - if (length == 0) - { - nrf_twi_event_t event; - if (stop) - { - event = NRF_TWI_EVENT_STOPPED; - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STOP); - } - else - { - event = NRF_TWI_EVENT_SUSPENDED; - nrf_twi_event_clear(twi, event); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_SUSPEND); - } - uint32_t remaining_time = TIMEOUT_VALUE; - - do - { - if (nrf_twi_event_check(twi, event)) - { - break; - } - } - while (--remaining_time); - - uint32_t errorsrc = nrf_twi_errorsrc_get_and_clear(twi); - if (errorsrc & NRF_TWI_ERROR_ADDRESS_NACK) - { - if (!stop) - { - i2c_stop(obj); - } - return I2C_ERROR_NO_SLAVE; - } - - return (remaining_time ? 0 : I2C_ERROR_BUS_BUSY); - } - - int result = length; - - do - { - uint8_t byte_write_result = twi_byte_write(twi, (uint8_t)*data++); - if (byte_write_result != 1) - { - if (byte_write_result == 0) - { - // Check what kind of error has been signaled by TWI. - uint32_t errorsrc = nrf_twi_errorsrc_get_and_clear(twi); - if (errorsrc & NRF_TWI_ERROR_ADDRESS_NACK) - { - result = I2C_ERROR_NO_SLAVE; - } - else - { - // Some other error - return the number of bytes that - // have been sent successfully. - result -= length; - } - } - else - { - result = I2C_ERROR_BUS_BUSY; - } - // Force STOP condition. - stop = 1; - break; - } - --length; - } - while (length > 0); - - if (stop) - { - (void)i2c_stop(obj); - } - - return result; -} - -int i2c_byte_read(i2c_t *obj, int last) -{ - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - - if (last) - { - nrf_twi_shorts_set(twi, NRF_TWI_SHORT_BB_STOP_MASK); - } - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - - uint32_t remaining_time = TIMEOUT_VALUE; - - do - { - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_RXDREADY)) - { - nrf_twi_event_clear(twi, NRF_TWI_EVENT_RXDREADY); - return nrf_twi_rxd_get(twi); - } - if (nrf_twi_event_check(twi, NRF_TWI_EVENT_ERROR)) - { - nrf_twi_event_clear(twi, NRF_TWI_EVENT_ERROR); - return I2C_ERROR_NO_SLAVE; - } - } - while (--remaining_time); - - return I2C_ERROR_BUS_BUSY; -} - -int i2c_byte_write(i2c_t *obj, int data) -{ - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - twi_info_t *twi_info = TWI_INFO(obj); - if (twi_info->start_twi) - { - twi_info->start_twi = false; - - if (data & 1) - { - start_twi_read(twi, data); - } - else - { - start_twi_write(twi, data); - } - return 1; - } - else - { - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - // 0 - TWI signaled error (NAK is the only possibility here) - // 1 - ACK received - // 2 - timeout (clock stretched for too long?) - return twi_byte_write(twi, (uint8_t)data); - } -} - - -#if DEVICE_I2C_ASYNCH -void i2c_transfer_asynch(i2c_t *obj, const void *tx, size_t tx_length, - void *rx, size_t rx_length, uint32_t address, - uint32_t stop, uint32_t handler, - uint32_t event, DMAUsage hint) -{ - (void)hint; - - twi_info_t *twi_info = TWI_INFO(obj); - if (twi_info->active) - { - return; - } - twi_info->active = true; - twi_info->events = 0; - twi_info->handler = (void (*)(void))handler; - twi_info->evt_mask = event; - twi_info->tx_length = tx_length; - twi_info->tx = tx; - twi_info->rx_length = rx_length; - twi_info->rx = rx; - twi_info->stop = stop; - - NRF_TWI_Type *twi = m_twi_instances[TWI_IDX(obj)]; - - nrf_twi_event_clear(twi, NRF_TWI_EVENT_TXDSENT); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_RXDREADY); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_STOPPED); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_SUSPENDED); - nrf_twi_event_clear(twi, NRF_TWI_EVENT_ERROR); - (void)nrf_twi_errorsrc_get_and_clear(twi); - - nrf_twi_address_set(twi, twi_address(address)); - nrf_twi_task_trigger(twi, NRF_TWI_TASK_RESUME); - // TX only, or TX + RX (after a repeated start). - if (tx_length > 0) - { - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STARTTX); - nrf_twi_txd_set(twi, *(twi_info->tx)); - ++(twi_info->tx); - // RX only. - } - else if (rx_length > 0) - { - start_asynch_rx(twi_info, twi); - // Both 'tx_length' and 'rx_length' are 0 - this case may be used - // to test if the slave is presentand ready for transfer (by just - // sending the address and checking if it is acknowledged). - } - else - { - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STARTTX); - if (stop) - { - nrf_twi_task_trigger(twi, NRF_TWI_TASK_STOP); - } - else - { - nrf_twi_task_trigger(twi, NRF_TWI_TASK_SUSPEND); - nrf_twi_int_enable(twi, NRF_TWI_INT_SUSPENDED_MASK); - } - twi_info->events |= I2C_EVENT_TRANSFER_COMPLETE; - } - - nrf_twi_int_enable(twi, NRF_TWI_INT_TXDSENT_MASK | - NRF_TWI_INT_RXDREADY_MASK | - NRF_TWI_INT_STOPPED_MASK | - NRF_TWI_INT_ERROR_MASK); -} - -uint32_t i2c_irq_handler_asynch(i2c_t *obj) -{ - twi_info_t *twi_info = TWI_INFO(obj); - return (twi_info->events & twi_info->evt_mask); -} - -uint8_t i2c_active(i2c_t *obj) -{ - twi_info_t *twi_info = TWI_INFO(obj); - return twi_info->active; -} - -void i2c_abort_asynch(i2c_t *obj) -{ - i2c_reset(obj); -} -#endif // DEVICE_I2C_ASYNCH - -#endif // DEVICE_I2C diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/irq_handlers_hw.h b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/irq_handlers_hw.h deleted file mode 100644 index 7eba37ad998..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/irq_handlers_hw.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file irq_handlers_hw.h - * @brief Heleper file for wiring irq handlers to theirs vectors. - */ - -#ifndef IRQ_HANDLERS_HW_H__ -#define IRQ_HANDLERS_HW_H__ - - -typedef struct -{ - IRQn_Type IRQn; - uint32_t vector; -} peripheral_handler_desc_t; - -#endif // IRQ_HANDLERS_HW_H__ - diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/lp_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/lp_ticker.c deleted file mode 100644 index ae63c2a1e1a..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/lp_ticker.c +++ /dev/null @@ -1,48 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2015 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "lp_ticker_api.h" - -#if DEVICE_LOWPOWERTIMER - -#include "common_rtc.h" - -void lp_ticker_init(void) -{ - common_rtc_init(); -} - -uint32_t lp_ticker_read() -{ - return (uint32_t)common_rtc_64bit_us_get(); -} - -void lp_ticker_set_interrupt(timestamp_t timestamp) -{ - common_rtc_set_interrupt(timestamp, - LP_TICKER_CC_CHANNEL, LP_TICKER_INT_MASK); -} - -void lp_ticker_disable_interrupt(void) -{ - nrf_rtc_event_disable(COMMON_RTC_INSTANCE, LP_TICKER_INT_MASK); -} - -void lp_ticker_clear_interrupt(void) -{ - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, LP_TICKER_EVENT); -} - -#endif // DEVICE_LOWPOWERTIMER diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/nordic_critical.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/nordic_critical.c deleted file mode 100644 index 3bcd4c9501a..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/nordic_critical.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2015-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include // uint32_t, UINT32_MAX -#include // uint32_t, UINT32_MAX -#include "cmsis.h" -#include "nrf_soc.h" -#include "nrf_sdm.h" -#include "nrf_nvic.h" - -static uint8_t _sd_state = 0; -static volatile uint32_t _entry_count = 0; - -void core_util_critical_section_enter() -{ - // if a critical section has already been entered, just update the counter - if (_entry_count) - { - ++_entry_count; - return; - } - - // in this path, a critical section has never been entered - // routine of SD V11 work even if the softdevice is not active - sd_nvic_critical_region_enter(&_sd_state); - - assert(_entry_count == 0); // entry count should always be equal to 0 at this point - ++_entry_count; -} - -void core_util_critical_section_exit() -{ - assert(_entry_count > 0); - --_entry_count; - - // If their is other segments which have entered the critical section, just leave - if (_entry_count) - { - return; - } - - // This is the last segment of the critical section, state should be restored as before entering - // the critical section - sd_nvic_critical_region_exit(_sd_state); -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/nrf5x_lf_clk_helper.h b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/nrf5x_lf_clk_helper.h deleted file mode 100644 index 08744be767f..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/nrf5x_lf_clk_helper.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2016 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef __NRF5X_LF_CLK_HELPER_H_ - -#ifndef MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC - #define MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC (NRF_LF_SRC_XTAL) - #warning No configuration for LF clock source. Xtal source will be used as a default configuration. -#endif - - - -#define NRF_LF_SRC_XTAL 2 -#define NRF_LF_SRC_SYNTH 3 -#define NRF_LF_SRC_RC 4 - -#if MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_SYNTH - #define CLOCK_LFCLKSRC_SRC_TO_USE (CLOCK_LFCLKSRC_SRC_Synth) -#elif MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_XTAL - #define CLOCK_LFCLKSRC_SRC_TO_USE (CLOCK_LFCLKSRC_SRC_Xtal) -#elif MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_RC - #define CLOCK_LFCLKSRC_SRC_TO_USE (CLOCK_LFCLKSRC_SRC_RC) -#else - #error Bad LFCLK configuration. Declare proper source through mbed configuration. -#endif - -#undef NRF_LF_SRC_XTAL -#undef NRF_LF_SRC_SYNTH -#undef NRF_LF_SRC_RC - -#endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/objects.h b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/objects.h deleted file mode 100644 index 104ff648348..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/objects.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2013 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef MBED_OBJECTS_H -#define MBED_OBJECTS_H - -#include "cmsis.h" -#include "PortNames.h" -#include "PeripheralNames.h" -#include "PinNames.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct serial_s -{ - uint32_t placeholder; // struct is unused by nRF5x API implementation -}; // but it must be not empty (required by strict compiler - IAR) - -struct spi_s -{ - uint8_t spi_idx; -}; - -struct port_s -{ - PortName port; - uint32_t mask; -}; - -struct pwmout_s -{ - PWMName pwm_name; - PinName pin; - uint8_t pwm_channel; - void * pwm_struct; -}; - -struct i2c_s -{ - uint8_t twi_idx; -}; - -struct analogin_s -{ - ADCName adc; - uint8_t adc_pin; -}; - -struct gpio_irq_s -{ - uint32_t ch; -}; - - -#include "gpio_object.h" - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/pinmap.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/pinmap.c deleted file mode 100644 index 26fa761c1db..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/pinmap.c +++ /dev/null @@ -1,37 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "mbed_assert.h" -#include "mbed_error.h" -#include "pinmap.h" - -void pin_function(PinName pin, int function) -{ - /* Avoid compiler warnings */ - (void) pin; - (void) function; -} - -void pin_mode(PinName pin, PinMode mode) -{ - MBED_ASSERT(pin != (PinName)NC); - - uint32_t pin_number = (uint32_t)pin; - - NRF_GPIO_Type * reg = nrf_gpio_pin_port_decode(&pin_number); - - reg->PIN_CNF[pin_number] &= ~GPIO_PIN_CNF_PULL_Msk; - reg->PIN_CNF[pin_number] |= (mode << GPIO_PIN_CNF_PULL_Pos); -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/port_api.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/port_api.c deleted file mode 100644 index faecdc9de53..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/port_api.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2013 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "port_api.h" -#include "pinmap.h" - -static NRF_GPIO_Type * const m_ports[] = GPIO_REG_LIST; - -#if defined(TARGET_MCU_NRF51822) - static const uint32_t m_gpio_pin_count[] = {31}; -#elif defined(TARGET_MCU_NRF52832) - static const uint32_t m_gpio_pin_count[] = {32}; -#elif defined(TARGET_MCU_NRF52840) - static const uint32_t m_gpio_pin_count[] = {32, 16}; -#else - #error not recognized gpio count for mcu -#endif - -#define GPIO_PORT_COUNT (sizeof(m_gpio_pin_count)/sizeof(uint32_t)) - - -PinName port_pin(PortName port, int pin_n) -{ - return (PinName)NRF_GPIO_PIN_MAP(port, pin_n); -} - -void port_init(port_t *obj, PortName port, int mask, PinDirection dir) -{ - MBED_ASSERT((uint32_t)port < GPIO_PORT_COUNT); - - obj->port = port; - obj->mask = mask; - - port_dir(obj, dir); -} - -void port_mode(port_t *obj, PinMode mode) -{ - uint32_t i; - // The mode is set per pin: reuse pinmap logic - for (i = 0; i < m_gpio_pin_count[obj->port]; i++) - { - if (obj->mask & (1 << i)) - { - pin_mode(port_pin(obj->port, i), mode); - } - } -} - -void port_dir(port_t *obj, PinDirection dir) -{ - uint32_t i; - - volatile uint32_t *reg_cnf = (volatile uint32_t*) m_ports[obj->port]->PIN_CNF; - - switch (dir) - { - case PIN_INPUT: - - for (i = 0; i < m_gpio_pin_count[obj->port]; i++) - { - if (obj->mask & (1 << i)) - { - reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) - | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) - | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) - | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos); - } - } - break; - - case PIN_OUTPUT: - - for (i = 0; i < m_gpio_pin_count[obj->port]; i++) - { - if (obj->mask & (1 << i)) - { - reg_cnf[i] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) - | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) - | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) - | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) - | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); - } - } - break; - } -} - -void port_write(port_t *obj, int value) -{ - m_ports[obj->port]->OUTSET = value & obj->mask; - m_ports[obj->port]->OUTCLR = (~value) & obj->mask; -} - -int port_read(port_t *obj) -{ - return ((m_ports[obj->port]->IN) & obj->mask); -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/reloc_vector_table.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/reloc_vector_table.c deleted file mode 100644 index bf9577331ab..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/reloc_vector_table.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2016 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "nrf.h" -#include "cmsis_nvic.h" -#include "stdint.h" -#include "nrf_sdm.h" -#include "section_vars.h" - -#if defined(__CC_ARM) - __attribute__ ((section("noinit"),zero_init)) - uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS]; -#elif defined(__GNUC__) - __attribute__ ((section(".noinit"))) - uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS]; -#elif defined(__ICCARM__) - uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS] @ ".noinit"; -#endif - - -typedef void (*generic_irq_handler_t)(void); - - -extern uint32_t __Vectors[]; -#define VECTORS_FLASH_START __Vectors - -/** - * @brief Function for relocation of the vector to RAM on nRF5x devices. - * This function is intended to be called during startup. - */ -void nrf_reloc_vector_table(void) -{ - // Copy and switch to dynamic vectors - uint32_t *old_vectors = (uint32_t*)VECTORS_FLASH_START; - uint32_t i; - - for (i = 0; i< NVIC_NUM_VECTORS; i++) - { - nrf_dispatch_vector[i] = old_vectors[i]; - } - - sd_softdevice_vector_table_base_set((uint32_t) nrf_dispatch_vector); -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/rtc_api.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/rtc_api.c deleted file mode 100644 index 589b85cd596..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/rtc_api.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2013 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "rtc_api.h" - -#if DEVICE_RTC - -#include "common_rtc.h" -#include "nrf_drv_clock.h" -#include "app_util_platform.h" - -static time_t m_time_base; - -void rtc_init(void) -{ - common_rtc_init(); -} - -void rtc_free(void) -{ - // A common counter is used for RTC, lp_ticker and us_ticker, so it can't be - // disabled here, but this does not cause any extra cost. Besides, currently - // this function is not used by RTC API in mbed-drivers. -} - -int rtc_isenabled(void) -{ - return m_common_rtc_enabled; -} - -static uint32_t rtc_seconds_get(void) -{ - // Convert current counter value to seconds. - uint32_t seconds = nrf_rtc_counter_get(COMMON_RTC_INSTANCE) / RTC_INPUT_FREQ; - // Add proper amount of seconds for each registered overflow of the counter. - uint32_t seconds_per_overflow = (1uL << RTC_COUNTER_BITS) / RTC_INPUT_FREQ; - return (seconds + (m_common_rtc_overflows * seconds_per_overflow)); -} - -time_t rtc_read(void) -{ - return m_time_base + rtc_seconds_get(); -} - -void rtc_write(time_t t) -{ - uint32_t seconds; - - do - { - seconds = rtc_seconds_get(); - m_time_base = t - seconds; - // If the number of seconds indicated by the counter changed during the - // update of the time base, just repeat the update, now using the new - // number of seconds. - } while (seconds != rtc_seconds_get()); -} - -#endif // DEVICE_RTC diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/serial_api.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/serial_api.c deleted file mode 100644 index e0b91656c8e..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/serial_api.c +++ /dev/null @@ -1,723 +0,0 @@ -/* - * Copyright (c) 2013 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "serial_api.h" - -#if DEVICE_SERIAL - -#include -#include "mbed_assert.h" -#include "mbed_error.h" -#include "nrf_uart.h" -#include "nrf_drv_common.h" -#include "app_util_platform.h" -#include "nrf_gpio.h" - -#define UART_INSTANCE_COUNT 1 -#define UART_INSTANCE NRF_UART0 -#define UART_IRQn UART0_IRQn -#define UART_IRQ_HANDLER UART0_IRQHandler -#define UART_INSTANCE_ID 0 -#define UART_CB uart_cb[UART_INSTANCE_ID] - -#define UART_DEFAULT_BAUDRATE UART_DEFAULT_CONFIG_BAUDRATE -#define UART_DEFAULT_PARITY UART_DEFAULT_CONFIG_PARITY - -// expected the macro from mbed configuration system -#ifndef MBED_CONF_NORDIC_UART_HWFC - #define MBED_CONF_NORDIC_UART_HWFC 1 - #warning None of UART flow control configuration (expected macro MBED_CONF_NORDIC_UART_HWFC). The RTSCTS flow control is used by default . -#endif - -#if MBED_CONF_NORDIC_UART_HWFC == 1 - #define UART_DEFAULT_HWFC UART_DEFAULT_CONFIG_HWFC -#else - #define UART_DEFAULT_HWFC NRF_UART_HWFC_DISABLED -#endif - -#define UART_DEFAULT_CTS CTS_PIN_NUMBER -#define UART_DEFAULT_RTS RTS_PIN_NUMBER - -#ifdef NRF51 - #define NRFx_MBED_UART_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW -#elif defined(NRF52) || defined(NRF52840_XXAA) - #define NRFx_MBED_UART_IRQ_PRIORITY APP_IRQ_PRIORITY_LOWEST -#endif - -// Required by "retarget.cpp". -int stdio_uart_inited = 0; -serial_t stdio_uart; - -typedef struct -{ - bool initialized; - uint32_t irq_context; - uart_irq_handler irq_handler; - - uint32_t pselrxd; - uint32_t pseltxd; - uint32_t pselcts; - uint32_t pselrts; - nrf_uart_hwfc_t hwfc; - nrf_uart_parity_t parity; - nrf_uart_baudrate_t baudrate; - -#if DEVICE_SERIAL_ASYNCH - bool volatile rx_active; - uint8_t *rx_buffer; - size_t rx_length; - size_t rx_pos; - void (*rx_asynch_handler)(); - uint8_t char_match; - - bool volatile tx_active; - const uint8_t *tx_buffer; - size_t tx_length; - size_t tx_pos; - void (*tx_asynch_handler)(); - - uint32_t events_wanted; - uint32_t events_occured; - -#define UART_IRQ_TX 1 -#define UART_IRQ_RX 2 - uint8_t irq_enabled; -#endif // DEVICE_SERIAL_ASYNCH -} uart_ctlblock_t; - -static uart_ctlblock_t uart_cb[UART_INSTANCE_COUNT]; - -static void internal_set_hwfc(FlowControl type, - PinName rxflow, PinName txflow); - - -#if DEVICE_SERIAL_ASYNCH -static void end_asynch_rx(void) -{ - // If RX interrupt is activated for synchronous operations, - // don't disable it, just stop handling it here. - if (!(UART_CB.irq_enabled & UART_IRQ_RX)) - { - nrf_uart_int_disable(UART_INSTANCE, NRF_UART_INT_MASK_RXDRDY); - } - UART_CB.rx_active = false; -} -static void end_asynch_tx(void) -{ - // If TX interrupt is activated for synchronous operations, - // don't disable it, just stop handling it here. - if (!(UART_CB.irq_enabled & UART_IRQ_TX)) - { - nrf_uart_int_disable(UART_INSTANCE, NRF_UART_INT_MASK_TXDRDY); - } - UART_CB.tx_active = false; -} -#endif // DEVICE_SERIAL_ASYNCH - -void UART_IRQ_HANDLER(void) -{ - if (nrf_uart_int_enable_check(UART_INSTANCE, NRF_UART_INT_MASK_RXDRDY) && - nrf_uart_event_check(UART_INSTANCE, NRF_UART_EVENT_RXDRDY)) - { - -#if DEVICE_SERIAL_ASYNCH - if (UART_CB.rx_active) - { - nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_RXDRDY); - - uint8_t rx_data = nrf_uart_rxd_get(UART_INSTANCE); - UART_CB.rx_buffer[UART_CB.rx_pos] = rx_data; - - bool end_rx = false; - // If character matching should be performed, check if the current - // data matches the given one. - if (UART_CB.char_match != SERIAL_RESERVED_CHAR_MATCH && - rx_data == UART_CB.char_match) - { - // If it does, report the match and abort further receiving. - UART_CB.events_occured |= SERIAL_EVENT_RX_CHARACTER_MATCH; - if (UART_CB.events_wanted & SERIAL_EVENT_RX_CHARACTER_MATCH) - { - end_rx = true; - } - } - if (++UART_CB.rx_pos >= UART_CB.rx_length) - { - UART_CB.events_occured |= SERIAL_EVENT_RX_COMPLETE; - end_rx = true; - } - if (end_rx) - { - end_asynch_rx(); - - if (UART_CB.rx_asynch_handler) - { - // Use local variable to make it possible to start a next - // transfer from callback routine. - void (*handler)() = UART_CB.rx_asynch_handler; - UART_CB.rx_asynch_handler = NULL; - handler(); - } - } - } - else -#endif - - if (UART_CB.irq_handler) - { - UART_CB.irq_handler(UART_CB.irq_context, RxIrq); - } - } - - if (nrf_uart_int_enable_check(UART_INSTANCE, NRF_UART_INT_MASK_TXDRDY) && - nrf_uart_event_check(UART_INSTANCE, NRF_UART_EVENT_TXDRDY)) - { - -#if DEVICE_SERIAL_ASYNCH - if (UART_CB.tx_active) - { - if (++UART_CB.tx_pos <= UART_CB.tx_length) - { - // When there is still something to send, clear the TXDRDY event - // and put next byte to transmitter. - nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_TXDRDY); - nrf_uart_txd_set(UART_INSTANCE, - UART_CB.tx_buffer[UART_CB.tx_pos]); - } - else - { - // When the TXDRDY event is set after the last byte to be sent - // has been passed to the transmitter, the job is done and TX - // complete can be indicated. - // Don't clear the TXDRDY event, it needs to remain set for the - // 'serial_writable' function to work properly. - end_asynch_tx(); - - UART_CB.events_occured |= SERIAL_EVENT_TX_COMPLETE; - if (UART_CB.tx_asynch_handler) - { - // Use local variable to make it possible to start a next - // transfer from callback routine. - void (*handler)() = UART_CB.tx_asynch_handler; - UART_CB.tx_asynch_handler = NULL; - handler(); - } - } - } - else -#endif - - if (UART_CB.irq_handler) - { - UART_CB.irq_handler(UART_CB.irq_context, TxIrq); - } - } - -#if DEVICE_SERIAL_ASYNCH - if (nrf_uart_event_check(UART_INSTANCE, NRF_UART_EVENT_ERROR)) - { - nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_ERROR); - - uint8_t errorsrc = nrf_uart_errorsrc_get_and_clear(UART_INSTANCE); - if (UART_CB.rx_asynch_handler) - { - UART_CB.events_occured |= SERIAL_EVENT_ERROR; - if (errorsrc & NRF_UART_ERROR_PARITY_MASK) - { - UART_CB.events_occured |= SERIAL_EVENT_RX_PARITY_ERROR; - } - if (errorsrc & NRF_UART_ERROR_FRAMING_MASK) - { - UART_CB.events_occured |= SERIAL_EVENT_RX_FRAMING_ERROR; - } - if (errorsrc & NRF_UART_ERROR_OVERRUN_MASK) - { - UART_CB.events_occured |= SERIAL_EVENT_RX_OVERRUN_ERROR; - } - UART_CB.rx_asynch_handler(); - } - } -#endif // DEVICE_SERIAL_ASYNCH -} - - -void serial_init(serial_t *obj, PinName tx, PinName rx) -{ - - NVIC_SetVector(UART0_IRQn, (uint32_t) UART0_IRQHandler); - - - UART_CB.pseltxd = - (tx == NC) ? NRF_UART_PSEL_DISCONNECTED : (uint32_t)tx; - UART_CB.pselrxd = - (rx == NC) ? NRF_UART_PSEL_DISCONNECTED : (uint32_t)rx; - if (UART_CB.pseltxd != NRF_UART_PSEL_DISCONNECTED) - { - nrf_gpio_pin_set(UART_CB.pseltxd); - nrf_gpio_cfg_output(UART_CB.pseltxd); - } - if (UART_CB.pselrxd != NRF_UART_PSEL_DISCONNECTED) - { - nrf_gpio_cfg_input(UART_CB.pselrxd, NRF_GPIO_PIN_NOPULL); - } - - if (UART_CB.initialized) - { - // For already initialized peripheral it is sufficient to reconfigure - // RX/TX pins only. - - // Ensure that there is no unfinished TX transfer. - while (!serial_writable(obj)) - { - } - // UART pins can be configured only when the peripheral is disabled. - nrf_uart_disable(UART_INSTANCE); - nrf_uart_txrx_pins_set(UART_INSTANCE, UART_CB.pseltxd, UART_CB.pselrxd); - nrf_uart_enable(UART_INSTANCE); - } - else - { - UART_CB.baudrate = (nrf_uart_baudrate_t)UART_DEFAULT_BAUDRATE; - UART_CB.parity = (nrf_uart_parity_t)UART_DEFAULT_PARITY; - UART_CB.hwfc = (nrf_uart_hwfc_t)UART_DEFAULT_HWFC; - UART_CB.pselcts = UART_DEFAULT_CTS; - UART_CB.pselrts = UART_DEFAULT_RTS; - - nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_RXDRDY); - nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_TXDRDY); - nrf_uart_task_trigger(UART_INSTANCE, NRF_UART_TASK_STARTRX); - nrf_uart_task_trigger(UART_INSTANCE, NRF_UART_TASK_STARTTX); - - nrf_uart_int_disable(UART_INSTANCE, NRF_UART_INT_MASK_RXDRDY | - NRF_UART_INT_MASK_TXDRDY); -#if DEVICE_SERIAL_ASYNCH - nrf_uart_int_enable(UART_INSTANCE, NRF_UART_INT_MASK_ERROR); -#endif - nrf_drv_common_irq_enable(UART_IRQn, NRFx_MBED_UART_IRQ_PRIORITY); - - // TX interrupt needs to be signaled when transmitter buffer is empty, - // so a dummy transmission is needed to get the TXDRDY event initially - // set. - nrf_uart_configure(UART_INSTANCE, - NRF_UART_PARITY_EXCLUDED, NRF_UART_HWFC_DISABLED); - // Use maximum baud rate, so this dummy transmission takes as little - // time as possible. - nrf_uart_baudrate_set(UART_INSTANCE, NRF_UART_BAUDRATE_1000000); - // Perform it with disconnected TX pin, so nothing actually comes out - // of the device. - nrf_uart_txrx_pins_disconnect(UART_INSTANCE); - nrf_uart_hwfc_pins_disconnect(UART_INSTANCE); - nrf_uart_enable(UART_INSTANCE); - nrf_uart_txd_set(UART_INSTANCE, 0); - - while (!nrf_uart_event_check(UART_INSTANCE, NRF_UART_EVENT_TXDRDY)) - { - } - nrf_uart_disable(UART_INSTANCE); - - // Now everything is prepared to set the default configuration and - // connect the peripheral to actual pins. - nrf_uart_txrx_pins_set(UART_INSTANCE, UART_CB.pseltxd, UART_CB.pselrxd); - nrf_uart_baudrate_set(UART_INSTANCE, UART_CB.baudrate); - nrf_uart_configure(UART_INSTANCE, UART_CB.parity, UART_CB.hwfc); - if (UART_CB.hwfc == NRF_UART_HWFC_ENABLED) - { - internal_set_hwfc(FlowControlRTSCTS, - (PinName) UART_CB.pselrts, (PinName) UART_CB.pselcts); - } - - nrf_uart_enable(UART_INSTANCE); - - UART_CB.initialized = true; - } - - if (tx == STDIO_UART_TX && rx == STDIO_UART_RX) - { - stdio_uart_inited = 1; - memcpy(&stdio_uart, obj, sizeof(serial_t)); - } - else - { - stdio_uart_inited = 0; - } -} - -void serial_free(serial_t *obj) -{ - (void)obj; - - if (UART_CB.initialized) - { - nrf_uart_disable(UART_INSTANCE); - nrf_uart_int_disable(UART_INSTANCE, NRF_UART_INT_MASK_RXDRDY | - NRF_UART_INT_MASK_TXDRDY | - NRF_UART_INT_MASK_ERROR); - nrf_drv_common_irq_disable(UART_IRQn); - UART_CB.initialized = false; - - // There is only one UART instance, thus at this point the stdio UART - // can no longer be initialized. - stdio_uart_inited = 0; - } -} - -void serial_baud(serial_t *obj, int baudrate) -{ - // nrf_uart_baudrate_set() is not used here (registers are accessed - // directly) to make it possible to set special baud rates like 56000 - // or 31250. - - static uint32_t const acceptedSpeeds[][2] = { - { 1200, UART_BAUDRATE_BAUDRATE_Baud1200 }, - { 2400, UART_BAUDRATE_BAUDRATE_Baud2400 }, - { 4800, UART_BAUDRATE_BAUDRATE_Baud4800 }, - { 9600, UART_BAUDRATE_BAUDRATE_Baud9600 }, - { 14400, UART_BAUDRATE_BAUDRATE_Baud14400 }, - { 19200, UART_BAUDRATE_BAUDRATE_Baud19200 }, - { 28800, UART_BAUDRATE_BAUDRATE_Baud28800 }, - { 31250, (0x00800000UL) /* 31250 baud */ }, - { 38400, UART_BAUDRATE_BAUDRATE_Baud38400 }, - { 56000, (0x00E51000UL) /* 56000 baud */ }, - { 57600, UART_BAUDRATE_BAUDRATE_Baud57600 }, - { 76800, UART_BAUDRATE_BAUDRATE_Baud76800 }, - { 115200, UART_BAUDRATE_BAUDRATE_Baud115200 }, - { 230400, UART_BAUDRATE_BAUDRATE_Baud230400 }, - { 250000, UART_BAUDRATE_BAUDRATE_Baud250000 }, - { 460800, UART_BAUDRATE_BAUDRATE_Baud460800 }, - { 921600, UART_BAUDRATE_BAUDRATE_Baud921600 }, - { 1000000, UART_BAUDRATE_BAUDRATE_Baud1M } - }; - - if (baudrate <= 1200) - { - UART_INSTANCE->BAUDRATE = UART_BAUDRATE_BAUDRATE_Baud1200; - return; - } - - int const item_cnt = sizeof(acceptedSpeeds)/sizeof(acceptedSpeeds[0]); - - for (int i = 1; i < item_cnt; i++) - { - if ((uint32_t)baudrate < acceptedSpeeds[i][0]) - { - UART_INSTANCE->BAUDRATE = acceptedSpeeds[i - 1][1]; - return; - } - } - - UART_INSTANCE->BAUDRATE = UART_BAUDRATE_BAUDRATE_Baud1M; -} - -void serial_format(serial_t *obj, - int data_bits, SerialParity parity, int stop_bits) -{ - (void)obj; - - if (data_bits != 8) - { - error("UART supports only 8 data bits.\r\n"); - } - if (stop_bits != 1) - { - error("UART supports only 1 stop bits.\r\n"); - } - if (parity == ParityNone) - { - UART_CB.parity = NRF_UART_PARITY_EXCLUDED; - } - else if (parity == ParityEven) - { - UART_CB.parity = NRF_UART_PARITY_INCLUDED; - } - else - { - error("UART supports only even parity.\r\n"); - } - - // Reconfigure UART peripheral. - nrf_uart_configure(UART_INSTANCE, UART_CB.parity, UART_CB.hwfc); -} - -void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id) -{ - (void)obj; - UART_CB.irq_handler = handler; - UART_CB.irq_context = id; -} - -void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) -{ - (void)obj; - if (enable) - { - switch (irq) - { - case RxIrq: -#if DEVICE_SERIAL_ASYNCH - UART_CB.irq_enabled |= UART_IRQ_RX; -#endif - nrf_uart_int_enable(UART_INSTANCE, NRF_UART_INT_MASK_RXDRDY); - break; - - case TxIrq: -#if DEVICE_SERIAL_ASYNCH - UART_CB.irq_enabled |= UART_IRQ_TX; -#endif - nrf_uart_int_enable(UART_INSTANCE, NRF_UART_INT_MASK_TXDRDY); - break; - } - } - else - { - switch (irq) - { - case RxIrq: -#if DEVICE_SERIAL_ASYNCH - UART_CB.irq_enabled &= ~UART_IRQ_RX; - if (!UART_CB.rx_active) -#endif - { - nrf_uart_int_disable(UART_INSTANCE, - NRF_UART_INT_MASK_RXDRDY); - } - break; - - case TxIrq: -#if DEVICE_SERIAL_ASYNCH - UART_CB.irq_enabled &= ~UART_IRQ_TX; - if (!UART_CB.tx_active) -#endif - { - nrf_uart_int_disable(UART_INSTANCE, - NRF_UART_INT_MASK_TXDRDY); - } - break; - } - } -} - -int serial_getc(serial_t *obj) -{ - while (!serial_readable(obj)) - { - } - - nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_RXDRDY); - return nrf_uart_rxd_get(UART_INSTANCE); -} - -void serial_putc(serial_t *obj, int c) -{ - while (!serial_writable(obj)) - { - } - - nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_TXDRDY); - nrf_uart_txd_set(UART_INSTANCE, (uint8_t)c); -} - -int serial_readable(serial_t *obj) -{ - (void)obj; -#if DEVICE_SERIAL_ASYNCH - if (UART_CB.rx_active) - { - return 0; - } -#endif - return (nrf_uart_event_check(UART_INSTANCE, NRF_UART_EVENT_RXDRDY)); -} - -int serial_writable(serial_t *obj) -{ - (void)obj; -#if DEVICE_SERIAL_ASYNCH - if (UART_CB.tx_active) - { - return 0; - } -#endif - return (nrf_uart_event_check(UART_INSTANCE, NRF_UART_EVENT_TXDRDY)); -} - -void serial_break_set(serial_t *obj) -{ - (void)obj; - nrf_uart_task_trigger(UART_INSTANCE, NRF_UART_TASK_SUSPEND); - nrf_uart_txrx_pins_disconnect(UART_INSTANCE); - nrf_gpio_pin_clear(UART_CB.pseltxd); -} - -void serial_break_clear(serial_t *obj) -{ - (void)obj; - nrf_gpio_pin_set(UART_CB.pseltxd); - nrf_uart_txrx_pins_set(UART_INSTANCE, UART_CB.pseltxd, UART_CB.pselrxd); - nrf_uart_task_trigger(UART_INSTANCE, NRF_UART_TASK_STARTRX); - nrf_uart_task_trigger(UART_INSTANCE, NRF_UART_TASK_STARTTX); -} - - -static void internal_set_hwfc(FlowControl type, - PinName rxflow, PinName txflow) -{ - UART_CB.pselrts = - ((rxflow == NC) || (type == FlowControlCTS)) ? NRF_UART_PSEL_DISCONNECTED : (uint32_t)rxflow; - UART_CB.pselcts = - ((txflow == NC) || (type == FlowControlRTS)) ? NRF_UART_PSEL_DISCONNECTED : (uint32_t)txflow; - - if (UART_CB.pselrts != NRF_UART_PSEL_DISCONNECTED) - { - nrf_gpio_pin_set(UART_CB.pselrts); - nrf_gpio_cfg_output(UART_CB.pselrts); - } - if (UART_CB.pselcts != NRF_UART_PSEL_DISCONNECTED) - { - nrf_gpio_cfg_input(UART_CB.pselcts, NRF_GPIO_PIN_NOPULL); - } - - UART_CB.hwfc = (nrf_uart_hwfc_t)((type == FlowControlNone)? NRF_UART_HWFC_DISABLED : UART_DEFAULT_CONFIG_HWFC); - - nrf_uart_configure(UART_INSTANCE, UART_CB.parity, UART_CB.hwfc); - nrf_uart_hwfc_pins_set(UART_INSTANCE, UART_CB.pselrts, UART_CB.pselcts); -} - -void serial_set_flow_control(serial_t *obj, FlowControl type, - PinName rxflow, PinName txflow) -{ - (void)obj; - - nrf_uart_disable(UART_INSTANCE); - internal_set_hwfc(type, rxflow, txflow); - nrf_uart_enable(UART_INSTANCE); -} - - -void serial_clear(serial_t *obj) -{ - (void)obj; -} - -#if DEVICE_SERIAL_ASYNCH - -int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, - uint8_t tx_width, uint32_t handler, uint32_t event, - DMAUsage hint) -{ - (void)obj; - (void)tx_width; - (void)hint; - if (UART_CB.tx_active || !tx_length) - { - return 0; - } - - UART_CB.tx_buffer = tx; - UART_CB.tx_length = tx_length; - UART_CB.tx_pos = 0; - UART_CB.tx_asynch_handler = (void(*)())handler; - UART_CB.events_wanted &= ~SERIAL_EVENT_TX_ALL; - UART_CB.events_wanted |= event; - - UART_CB.tx_active = true; - nrf_uart_int_enable(UART_INSTANCE, NRF_UART_INT_MASK_TXDRDY); - - return 0; -} - -void serial_rx_asynch(serial_t *obj, void *rx, size_t rx_length, - uint8_t rx_width, uint32_t handler, uint32_t event, - uint8_t char_match, DMAUsage hint) -{ - (void)obj; - (void)rx_width; - (void)hint; - if (UART_CB.rx_active || !rx_length) - { - return; - } - - UART_CB.rx_buffer = rx; - UART_CB.rx_length = rx_length; - UART_CB.rx_pos = 0; - UART_CB.rx_asynch_handler = (void(*)())handler; - UART_CB.events_wanted &= ~SERIAL_EVENT_RX_ALL; - UART_CB.events_wanted |= event; - UART_CB.char_match = char_match; - - UART_CB.rx_active = true; - nrf_uart_int_enable(UART_INSTANCE, NRF_UART_INT_MASK_RXDRDY); -} - -uint8_t serial_tx_active(serial_t *obj) -{ - (void)obj; - return UART_CB.tx_active; -} - -uint8_t serial_rx_active(serial_t *obj) -{ - (void)obj; - return UART_CB.rx_active; -} - -int serial_irq_handler_asynch(serial_t *obj) -{ - (void)obj; - uint32_t events_to_report = UART_CB.events_wanted & UART_CB.events_occured; - UART_CB.events_occured &= (~events_to_report); - return events_to_report; -} - -void serial_tx_abort_asynch(serial_t *obj) -{ - (void)obj; - end_asynch_tx(); - UART_CB.tx_asynch_handler = NULL; -} - -void serial_rx_abort_asynch(serial_t *obj) -{ - (void)obj; - end_asynch_rx(); - UART_CB.rx_asynch_handler = NULL; -} - -#endif // DEVICE_SERIAL_ASYNCH - -#endif // DEVICE_SERIAL diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sleep.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sleep.c deleted file mode 100644 index cc73962fccb..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sleep.c +++ /dev/null @@ -1,85 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sleep_api.h" -#include "cmsis.h" -#include "mbed_interface.h" -#include "softdevice_handler.h" -#include "nrf_soc.h" - -// Mask of reserved bits of the register ICSR in the System Control Block peripheral -// In this case, bits which are equal to 0 are the bits reserved in this register -#define SCB_ICSR_RESERVED_BITS_MASK 0x9E43F03F - -#define FPU_EXCEPTION_MASK 0x0000009F - -void hal_sleep(void) -{ - // ensure debug is disconnected if semihost is enabled.... - - // Trigger an event when an interrupt is pending. This allows to wake up - // the processor from disabled interrupts. - SCB->SCR |= SCB_SCR_SEVONPEND_Msk; - -#if defined(NRF52) || defined(NRF52840_XXAA) - /* Clear exceptions and PendingIRQ from the FPU unit */ - __set_FPSCR(__get_FPSCR() & ~(FPU_EXCEPTION_MASK)); - (void) __get_FPSCR(); - NVIC_ClearPendingIRQ(FPU_IRQn); -#endif - - // If the SoftDevice is enabled, its API must be used to go to sleep. - if (softdevice_handler_is_enabled()) - { - sd_power_mode_set(NRF_POWER_MODE_LOWPWR); - sd_app_evt_wait(); - } - else - { - NRF_POWER->TASKS_LOWPWR = 1; - - // Note: it is not sufficient to just use WFE here, since the internal - // event register may be already set from an event that occurred in the - // past (like an SVC call to the SoftDevice) and in such case WFE will - // just clear the register and continue execution. - // Therefore, the strategy here is to first clear the event register - // by using SEV/WFE pair, and then execute WFE again, unless there is - // a pending interrupt. - - // Set an event and wake up whatsoever, this will clear the event - // register from all previous events set (SVC call included) - __SEV(); - __WFE(); - - // Test if there is an interrupt pending (mask reserved regions) - if (SCB->ICSR & (SCB_ICSR_RESERVED_BITS_MASK)) - { - // Ok, there is an interrut pending, no need to go to sleep - return; - } - else - { - // next event will wakeup the CPU - // If an interrupt occured between the test of SCB->ICSR and this - // instruction, WFE will just not put the CPU to sleep - __WFE(); - } - } -} - -void hal_deepsleep(void) -{ - hal_sleep(); -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/spi_api.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/spi_api.c deleted file mode 100644 index da757720990..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/spi_api.c +++ /dev/null @@ -1,600 +0,0 @@ -/* - * Copyright (c) 2013 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - - -#include "spi_api.h" - -#if DEVICE_SPI - -#include "cmsis.h" -#include "pinmap.h" -#include "mbed_assert.h" -#include "mbed_error.h" -#include "nrf_drv_spi.h" -#include "nrf_drv_spis.h" -#include "app_util_platform.h" - -#if DEVICE_SPI_ASYNCH - #define SPI_IDX(obj) ((obj)->spi.spi_idx) -#else - #define SPI_IDX(obj) ((obj)->spi_idx) -#endif -#define SPI_INFO(obj) (&m_spi_info[SPI_IDX(obj)]) -#define MASTER_INST(obj) (&m_instances[SPI_IDX(obj)].master) -#define SLAVE_INST(obj) (&m_instances[SPI_IDX(obj)].slave) - -typedef struct -{ - bool initialized; - bool master; - uint8_t sck_pin; - uint8_t mosi_pin; - uint8_t miso_pin; - uint8_t ss_pin; - uint8_t spi_mode; - nrf_drv_spi_frequency_t frequency; - volatile union - { - bool busy; // master - bool readable; // slave - } flag; - volatile uint8_t tx_buf; - volatile uint8_t rx_buf; - -#if DEVICE_SPI_ASYNCH - uint32_t handler; - uint32_t event; -#endif -} spi_info_t; -static spi_info_t m_spi_info[SPI_COUNT]; - -typedef struct -{ - nrf_drv_spi_t master; - nrf_drv_spis_t slave; -} sdk_driver_instances_t; - -void SPI0_TWI0_IRQHandler(void); -void SPI1_TWI1_IRQHandler(void); -void SPIM2_SPIS2_SPI2_IRQHandler(void); - -static const peripheral_handler_desc_t spi_handler_desc[SPI_COUNT] = { -#if SPI0_ENABLED - { - SPI0_IRQ, - (uint32_t) SPI0_TWI0_IRQHandler - }, -#endif -#if SPI1_ENABLED - { - SPI1_IRQ, - (uint32_t) SPI1_TWI1_IRQHandler - }, -#endif -#if SPI2_ENABLED - { - SPI2_IRQ, - (uint32_t) SPIM2_SPIS2_SPI2_IRQHandler - }, -#endif -}; - - -static sdk_driver_instances_t m_instances[SPI_COUNT] = { -#if SPI0_ENABLED - { - NRF_DRV_SPI_INSTANCE(0), - NRF_DRV_SPIS_INSTANCE(0) - }, -#endif -#if SPI1_ENABLED - { - NRF_DRV_SPI_INSTANCE(1), - NRF_DRV_SPIS_INSTANCE(1) - }, -#endif -#if SPI2_ENABLED - { - NRF_DRV_SPI_INSTANCE(2), - NRF_DRV_SPIS_INSTANCE(2) - }, -#endif -}; - -static void master_event_handler(uint8_t spi_idx, - nrf_drv_spi_evt_t const *p_event) -{ - spi_info_t *p_spi_info = &m_spi_info[spi_idx]; - - if (p_event->type == NRF_DRV_SPI_EVENT_DONE) - { - p_spi_info->flag.busy = false; - if (p_spi_info->handler) - { - void (*handler)(void) = (void (*)(void))p_spi_info->handler; - p_spi_info->handler = 0; - handler(); - } - } -} -#define MASTER_EVENT_HANDLER(idx) \ - static void master_event_handler_##idx(nrf_drv_spi_evt_t const *p_event) { \ - master_event_handler(SPI##idx##_INSTANCE_INDEX, p_event); \ - } -#if SPI0_ENABLED - MASTER_EVENT_HANDLER(0) -#endif -#if SPI1_ENABLED - MASTER_EVENT_HANDLER(1) -#endif -#if SPI2_ENABLED - MASTER_EVENT_HANDLER(2) -#endif - -static nrf_drv_spi_handler_t const m_master_event_handlers[SPI_COUNT] = { -#if SPI0_ENABLED - master_event_handler_0, -#endif -#if SPI1_ENABLED - master_event_handler_1, -#endif -#if SPI2_ENABLED - master_event_handler_2, -#endif -}; - - -static void slave_event_handler(uint8_t spi_idx, - nrf_drv_spis_event_t event) -{ - spi_info_t *p_spi_info = &m_spi_info[spi_idx]; - - if (event.evt_type == NRF_DRV_SPIS_XFER_DONE) - { - // Signal that there is some data received that could be read. - p_spi_info->flag.readable = true; - - // And prepare for the next transfer. - // Previous data set in 'spi_slave_write' (if any) has been transmitted, - // now use the default one, until some new is set by 'spi_slave_write'. - p_spi_info->tx_buf = SPIS_DEFAULT_ORC; - nrf_drv_spis_buffers_set(&m_instances[spi_idx].slave, - (uint8_t const *)&p_spi_info->tx_buf, 1, - (uint8_t *)&p_spi_info->rx_buf, 1); - } -} -#define SLAVE_EVENT_HANDLER(idx) \ - static void slave_event_handler_##idx(nrf_drv_spis_event_t event) { \ - slave_event_handler(SPIS##idx##_INSTANCE_INDEX, event); \ - } -#if SPIS0_ENABLED - SLAVE_EVENT_HANDLER(0) -#endif -#if SPIS1_ENABLED - SLAVE_EVENT_HANDLER(1) -#endif -#if SPIS2_ENABLED - SLAVE_EVENT_HANDLER(2) -#endif - -static nrf_drv_spis_event_handler_t const m_slave_event_handlers[SPIS_COUNT] = { -#if SPIS0_ENABLED - slave_event_handler_0, -#endif -#if SPIS1_ENABLED - slave_event_handler_1, -#endif -#if SPIS2_ENABLED - slave_event_handler_2, -#endif -}; - -static void prepare_master_config(nrf_drv_spi_config_t *p_config, - spi_info_t const *p_spi_info) -{ - p_config->sck_pin = p_spi_info->sck_pin; - p_config->mosi_pin = p_spi_info->mosi_pin; - p_config->miso_pin = p_spi_info->miso_pin; - p_config->ss_pin = p_spi_info->ss_pin; - p_config->frequency = p_spi_info->frequency; - p_config->mode = (nrf_drv_spi_mode_t)p_spi_info->spi_mode; - - p_config->irq_priority = SPI_DEFAULT_CONFIG_IRQ_PRIORITY; - p_config->orc = 0xFF; - p_config->bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST; -} - -static void prepare_slave_config(nrf_drv_spis_config_t *p_config, - spi_info_t const *p_spi_info) -{ - p_config->sck_pin = p_spi_info->sck_pin; - p_config->mosi_pin = p_spi_info->mosi_pin; - p_config->miso_pin = p_spi_info->miso_pin; - p_config->csn_pin = p_spi_info->ss_pin; - p_config->mode = (nrf_drv_spis_mode_t)p_spi_info->spi_mode; - - p_config->irq_priority = SPIS_DEFAULT_CONFIG_IRQ_PRIORITY; - p_config->orc = SPIS_DEFAULT_ORC; - p_config->def = SPIS_DEFAULT_DEF; - p_config->bit_order = NRF_DRV_SPIS_BIT_ORDER_MSB_FIRST; - p_config->csn_pullup = NRF_DRV_SPIS_DEFAULT_CSN_PULLUP; - p_config->miso_drive = NRF_DRV_SPIS_DEFAULT_MISO_DRIVE; -} - -void spi_init(spi_t *obj, - PinName mosi, PinName miso, PinName sclk, PinName ssel) -{ - int i; - - // This block is only a workaround that allows to create SPI object several - // times, what would be otherwise impossible in the current implementation - // of mbed driver that does not call spi_free() from SPI destructor. - // Once this mbed's imperfection is corrected, this block should be removed. - for (i = 0; i < SPI_COUNT; ++i) - { - spi_info_t *p_spi_info = &m_spi_info[i]; - - if (p_spi_info->initialized && - p_spi_info->mosi_pin == (uint8_t)mosi && - p_spi_info->miso_pin == (uint8_t)miso && - p_spi_info->sck_pin == (uint8_t)sclk && - p_spi_info->ss_pin == (uint8_t)ssel) - { - // Reuse the already allocated SPI instance (instead of allocating - // a new one), if it appears to be initialized with exactly the same - // pin assignments. - SPI_IDX(obj) = i; - return; - } - } - - for (i = 0; i < SPI_COUNT; ++i) - { - spi_info_t *p_spi_info = &m_spi_info[i]; - - if (!p_spi_info->initialized) - { - p_spi_info->sck_pin = (uint8_t)sclk; - p_spi_info->mosi_pin = (mosi != NC) ? - (uint8_t)mosi : NRF_DRV_SPI_PIN_NOT_USED; - p_spi_info->miso_pin = (miso != NC) ? - (uint8_t)miso : NRF_DRV_SPI_PIN_NOT_USED; - p_spi_info->ss_pin = (ssel != NC) ? - (uint8_t)ssel : NRF_DRV_SPI_PIN_NOT_USED; - p_spi_info->spi_mode = (uint8_t)NRF_DRV_SPI_MODE_0; - p_spi_info->frequency = NRF_DRV_SPI_FREQ_1M; - - NVIC_SetVector(spi_handler_desc[i].IRQn, spi_handler_desc[i].vector); - - // By default each SPI instance is initialized to work as a master. - // Should the slave mode be used, the instance will be reconfigured - // appropriately in 'spi_format'. - nrf_drv_spi_config_t config; - prepare_master_config(&config, p_spi_info); - - nrf_drv_spi_t const *p_spi = &m_instances[i].master; - ret_code_t ret_code = nrf_drv_spi_init(p_spi, - &config, m_master_event_handlers[i]); - if (ret_code == NRF_SUCCESS) - { - p_spi_info->initialized = true; - p_spi_info->master = true; - p_spi_info->flag.busy = false; -#if DEVICE_SPI_ASYNCH - p_spi_info->handler = 0; -#endif - SPI_IDX(obj) = i; - - return; - } - } - } - - // No available peripheral - error("No available SPI peripheral\r\n"); -} - -void spi_free(spi_t *obj) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - - if (p_spi_info->master) - { - nrf_drv_spi_uninit(MASTER_INST(obj)); - } - else - { - nrf_drv_spis_uninit(SLAVE_INST(obj)); - } - p_spi_info->initialized = false; -} - -int spi_busy(spi_t *obj) -{ - return (int)(SPI_INFO(obj)->flag.busy); -} - -void spi_format(spi_t *obj, int bits, int mode, int slave) -{ - if (bits != 8) - { - error("Only 8-bits SPI is supported\r\n"); - } - if (mode > 3) - { - error("SPI format error\r\n"); - } - - spi_info_t *p_spi_info = SPI_INFO(obj); - - if (slave) - { - nrf_drv_spis_mode_t spi_modes[4] = { - NRF_DRV_SPIS_MODE_0, - NRF_DRV_SPIS_MODE_1, - NRF_DRV_SPIS_MODE_2, - NRF_DRV_SPIS_MODE_3, - }; - nrf_drv_spis_mode_t new_mode = spi_modes[mode]; - - // If the peripheral is currently working as a master, the SDK driver - // it uses needs to be switched from SPI to SPIS. - if (p_spi_info->master) - { - nrf_drv_spi_uninit(MASTER_INST(obj)); - } - // I the SPI mode has to be changed, the SDK's SPIS driver needs to be - // re-initialized (there is no other way to change its configuration). - else if (p_spi_info->spi_mode != (uint8_t)new_mode) - { - nrf_drv_spis_uninit(SLAVE_INST(obj)); - } - else - { - return; - } - - p_spi_info->spi_mode = (uint8_t)new_mode; - p_spi_info->master = false; - p_spi_info->flag.readable = false; - - // Initialize SDK's SPIS driver with the new configuration. - nrf_drv_spis_config_t config; - prepare_slave_config(&config, p_spi_info); - (void)nrf_drv_spis_init(SLAVE_INST(obj), &config, - m_slave_event_handlers[SPI_IDX(obj)]); - - // Prepare the slave for transfer. - p_spi_info->tx_buf = SPIS_DEFAULT_ORC; - nrf_drv_spis_buffers_set(SLAVE_INST(obj), - (uint8_t const *)&p_spi_info->tx_buf, 1, - (uint8_t *)&p_spi_info->rx_buf, 1); - } - else // master - { - nrf_drv_spi_mode_t spi_modes[4] = { - NRF_DRV_SPI_MODE_0, - NRF_DRV_SPI_MODE_1, - NRF_DRV_SPI_MODE_2, - NRF_DRV_SPI_MODE_3, - }; - nrf_drv_spi_mode_t new_mode = spi_modes[mode]; - - // If the peripheral is currently working as a slave, the SDK driver - // it uses needs to be switched from SPIS to SPI. - if (!p_spi_info->master) - { - nrf_drv_spis_uninit(SLAVE_INST(obj)); - } - // I the SPI mode has to be changed, the SDK's SPI driver needs to be - // re-initialized (there is no other way to change its configuration). - else if (p_spi_info->spi_mode != (uint8_t)new_mode) - { - nrf_drv_spi_uninit(MASTER_INST(obj)); - } - else - { - return; - } - - p_spi_info->spi_mode = (uint8_t)new_mode; - p_spi_info->master = true; - p_spi_info->flag.busy = false; - - // Initialize SDK's SPI driver with the new configuration. - nrf_drv_spi_config_t config; - prepare_master_config(&config, p_spi_info); - (void)nrf_drv_spi_init(MASTER_INST(obj), &config, - m_master_event_handlers[SPI_IDX(obj)]); - } -} - -static nrf_drv_spi_frequency_t freq_translate(int hz) -{ - nrf_drv_spi_frequency_t frequency; - - if (hz<250000) //125Kbps - { - frequency = NRF_DRV_SPI_FREQ_125K; - } - else if (hz<500000) //250Kbps - { - frequency = NRF_DRV_SPI_FREQ_250K; - } - else if (hz<1000000) //500Kbps - { - frequency = NRF_DRV_SPI_FREQ_500K; - } - else if (hz<2000000) //1Mbps - { - frequency = NRF_DRV_SPI_FREQ_1M; - } - else if (hz<4000000) //2Mbps - { - frequency = NRF_DRV_SPI_FREQ_2M; - } - else if (hz<8000000) //4Mbps - { - frequency = NRF_DRV_SPI_FREQ_4M; - } - else //8Mbps - { - frequency = NRF_DRV_SPI_FREQ_8M; - } - return frequency; -} - -void spi_frequency(spi_t *obj, int hz) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - nrf_drv_spi_frequency_t new_frequency = freq_translate(hz); - - if (p_spi_info->master) - { - if (p_spi_info->frequency != new_frequency) - { - p_spi_info->frequency = new_frequency; - - nrf_drv_spi_config_t config; - prepare_master_config(&config, p_spi_info); - - nrf_drv_spi_t const *p_spi = MASTER_INST(obj); - nrf_drv_spi_uninit(p_spi); - (void)nrf_drv_spi_init(p_spi, &config, - m_master_event_handlers[SPI_IDX(obj)]); - } - } - // There is no need to set anything in slaves when it comes to frequency, - // since slaves just synchronize with the clock provided by a master. -} - -int spi_master_write(spi_t *obj, int value) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - -#if DEVICE_SPI_ASYNCH - - while (p_spi_info->flag.busy) - { - } -#endif - - p_spi_info->tx_buf = value; - p_spi_info->flag.busy = true; - (void)nrf_drv_spi_transfer(MASTER_INST(obj), - (uint8_t const *)&p_spi_info->tx_buf, 1, - (uint8_t *)&p_spi_info->rx_buf, 1); - - while (p_spi_info->flag.busy) - { - } - - return p_spi_info->rx_buf; -} - -int spi_slave_receive(spi_t *obj) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - MBED_ASSERT(!p_spi_info->master); - return p_spi_info->flag.readable; -} - -int spi_slave_read(spi_t *obj) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - MBED_ASSERT(!p_spi_info->master); - - while (!p_spi_info->flag.readable) - { - } - p_spi_info->flag.readable = false; - return p_spi_info->rx_buf; -} - -void spi_slave_write(spi_t *obj, int value) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - MBED_ASSERT(!p_spi_info->master); - - p_spi_info->tx_buf = (uint8_t)value; -} - -#if DEVICE_SPI_ASYNCH - -void spi_master_transfer(spi_t *obj, - const void *tx, size_t tx_length, - void *rx, size_t rx_length, uint8_t bit_width, - uint32_t handler, uint32_t event, DMAUsage hint) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - MBED_ASSERT(p_spi_info->master); - (void)hint; - (void)bit_width; - - p_spi_info->handler = handler; - p_spi_info->event = event; - - p_spi_info->flag.busy = true; - (void)nrf_drv_spi_transfer(MASTER_INST(obj), - (uint8_t const *)tx, tx_length, - (uint8_t *)rx, rx_length); -} - -uint32_t spi_irq_handler_asynch(spi_t *obj) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - MBED_ASSERT(p_spi_info->master); - return p_spi_info->event & SPI_EVENT_COMPLETE; -} - -uint8_t spi_active(spi_t *obj) -{ - spi_info_t *p_spi_info = SPI_INFO(obj); - MBED_ASSERT(p_spi_info->master); - return p_spi_info->flag.busy; -} - -void spi_abort_asynch(spi_t *obj) -{ - MBED_ASSERT(SPI_INFO(obj)->master); - nrf_drv_spi_abort(MASTER_INST(obj)); -} - -#endif // DEVICE_SPI_ASYNCH - -#endif // DEVICE_SPI diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c deleted file mode 100644 index f716e235bb4..00000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c +++ /dev/null @@ -1,636 +0,0 @@ -/* - * Copyright (c) 2013 Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list - * of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA - * integrated circuit in a product or a software update for such product, must reproduce - * the above copyright notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be - * used to endorse or promote products derived from this software without specific prior - * written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary or object form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "us_ticker_api.h" -#include "common_rtc.h" -#include "app_util.h" -#include "nrf_drv_common.h" -#include "lp_ticker_api.h" -#include "mbed_critical.h" - -#if defined(NRF52_ERRATA_20) - #include "softdevice_handler.h" -#endif - -//------------------------------------------------------------------------------ -// Common stuff used also by lp_ticker and rtc_api (see "common_rtc.h"). -// -#include "app_util_platform.h" - -bool m_common_rtc_enabled = false; -uint32_t volatile m_common_rtc_overflows = 0; - -__STATIC_INLINE void rtc_ovf_event_check(void) -{ - if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW)) { - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - // Don't disable this event. It shall occur periodically. - - ++m_common_rtc_overflows; - } -} - -#if defined(TARGET_MCU_NRF51822) -void common_rtc_irq_handler(void) -#else -void COMMON_RTC_IRQ_HANDLER(void) -#endif -{ - - rtc_ovf_event_check(); - - if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, US_TICKER_EVENT)) { - us_ticker_irq_handler(); - } - -#if DEVICE_LOWPOWERTIMER - if (nrf_rtc_event_pending(COMMON_RTC_INSTANCE, LP_TICKER_EVENT)) { - - lp_ticker_irq_handler(); - } -#endif - -} - -// Function for fix errata 20: RTC Register values are invalid -__STATIC_INLINE void errata_20(void) -{ -#if defined(NRF52_ERRATA_20) - if (!softdevice_handler_is_enabled()) - { - NRF_CLOCK->EVENTS_LFCLKSTARTED = 0; - NRF_CLOCK->TASKS_LFCLKSTART = 1; - - while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) - { - } - } - NRF_RTC1->TASKS_STOP = 0; -#endif -} - -#if (defined (__ICCARM__)) && defined(TARGET_MCU_NRF51822)//IAR -__stackless __task -#endif -void RTC1_IRQHandler(void); - -void common_rtc_init(void) -{ - if (m_common_rtc_enabled) { - return; - } - - errata_20(); - - NVIC_SetVector(RTC1_IRQn, (uint32_t)RTC1_IRQHandler); - - // RTC is driven by the low frequency (32.768 kHz) clock, a proper request - // must be made to have it running. - // Currently this clock is started in 'SystemInit' (see "system_nrf51.c" - // or "system_nrf52.c", respectively). - - nrf_rtc_prescaler_set(COMMON_RTC_INSTANCE, 0); - - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, US_TICKER_EVENT); -#if defined(TARGET_MCU_NRF51822) - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, OS_TICK_EVENT); -#endif -#if DEVICE_LOWPOWERTIMER - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, LP_TICKER_EVENT); -#endif - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - - // Interrupts on all related events are enabled permanently. Particular - // events will be enabled or disabled as needed (such approach is more - // energy efficient). - nrf_rtc_int_enable(COMMON_RTC_INSTANCE, -#if DEVICE_LOWPOWERTIMER - LP_TICKER_INT_MASK | -#endif - US_TICKER_INT_MASK | - NRF_RTC_INT_OVERFLOW_MASK); - - // This event is enabled permanently, since overflow indications are needed - // continuously. - nrf_rtc_event_enable(COMMON_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - // All other relevant events are initially disabled. - nrf_rtc_event_disable(COMMON_RTC_INSTANCE, -#if defined(TARGET_MCU_NRF51822) - OS_TICK_INT_MASK | -#endif -#if DEVICE_LOWPOWERTIMER - LP_TICKER_INT_MASK | -#endif - US_TICKER_INT_MASK); - - nrf_drv_common_irq_enable(nrf_drv_get_IRQn(COMMON_RTC_INSTANCE), -#ifdef NRF51 - APP_IRQ_PRIORITY_LOW -#elif defined(NRF52) || defined(NRF52840_XXAA) - APP_IRQ_PRIORITY_LOWEST -#endif - ); - - nrf_rtc_task_trigger(COMMON_RTC_INSTANCE, NRF_RTC_TASK_START); - - m_common_rtc_enabled = true; -} - -__STATIC_INLINE void rtc_ovf_event_safe_check(void) -{ - core_util_critical_section_enter(); - - rtc_ovf_event_check(); - - core_util_critical_section_exit(); -} - - -uint32_t common_rtc_32bit_ticks_get(void) -{ - uint32_t ticks; - uint32_t prev_overflows; - - do { - prev_overflows = m_common_rtc_overflows; - - ticks = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); - // The counter used for time measurements is less than 32 bit wide, - // so its value is complemented with the number of registered overflows - // of the counter. - ticks += (m_common_rtc_overflows << RTC_COUNTER_BITS); - - // Check in case that OVF occurred during execution of a RTC handler (apply if call was from RTC handler) - // m_common_rtc_overflows might been updated in this call. - rtc_ovf_event_safe_check(); - - // If call was made from a low priority level m_common_rtc_overflows might have been updated in RTC handler. - } while (m_common_rtc_overflows != prev_overflows); - - return ticks; -} - -uint64_t common_rtc_64bit_us_get(void) -{ - uint32_t ticks = common_rtc_32bit_ticks_get(); - // [ticks -> microseconds] - return ROUNDED_DIV(((uint64_t)ticks) * 1000000, RTC_INPUT_FREQ); -} - -void common_rtc_set_interrupt(uint32_t us_timestamp, uint32_t cc_channel, - uint32_t int_mask) -{ - // The internal counter is clocked with a frequency that cannot be easily - // multiplied to 1 MHz, therefore besides the translation of values - // (microsecond <-> ticks) a special care of overflows handling must be - // taken. Here the 32-bit timestamp value is complemented with information - // about current the system up time of (ticks + number of overflows of tick - // counter on upper bits, converted to microseconds), and such 64-bit value - // is then translated to counter ticks. Finally, the lower 24 bits of thus - // calculated value is written to the counter compare register to prepare - // the interrupt generation. - uint64_t current_time64 = common_rtc_64bit_us_get(); - // [add upper 32 bits from the current time to the timestamp value] - uint64_t timestamp64 = us_timestamp + - (current_time64 & ~(uint64_t)0xFFFFFFFF); - // [if the original timestamp value happens to be after the 32 bit counter - // of microsends overflows, correct the upper 32 bits accordingly] - if (us_timestamp < (uint32_t)(current_time64 & 0xFFFFFFFF)) { - timestamp64 += ((uint64_t)1 << 32); - } - // [microseconds -> ticks, always round the result up to avoid too early - // interrupt generation] - uint32_t compare_value = - (uint32_t)CEIL_DIV((timestamp64) * RTC_INPUT_FREQ, 1000000); - - core_util_critical_section_enter(); - // The COMPARE event occurs when the value in compare register is N and - // the counter value changes from N-1 to N. Therefore, the minimal safe - // difference between the compare value to be set and the current counter - // value is 2 ticks. This guarantees that the compare trigger is properly - // setup before the compare condition occurs. - uint32_t closest_safe_compare = common_rtc_32bit_ticks_get() + 2; - if ((int)(compare_value - closest_safe_compare) <= 0) { - compare_value = closest_safe_compare; - } - - nrf_rtc_cc_set(COMMON_RTC_INSTANCE, cc_channel, RTC_WRAP(compare_value)); - nrf_rtc_event_enable(COMMON_RTC_INSTANCE, int_mask); - core_util_critical_section_exit(); -} -//------------------------------------------------------------------------------ - - -void us_ticker_init(void) -{ - common_rtc_init(); -} - -uint32_t us_ticker_read() -{ - us_ticker_init(); - return (uint32_t)common_rtc_64bit_us_get(); -} - -void us_ticker_set_interrupt(timestamp_t timestamp) -{ - common_rtc_set_interrupt(timestamp, - US_TICKER_CC_CHANNEL, US_TICKER_INT_MASK); -} - -void us_ticker_disable_interrupt(void) -{ - nrf_rtc_event_disable(COMMON_RTC_INSTANCE, US_TICKER_INT_MASK); -} - -void us_ticker_clear_interrupt(void) -{ - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, US_TICKER_EVENT); -} - - -// Since there is no SysTick on NRF51, the RTC1 channel 1 is used as an -// alternative source of RTOS ticks. -#if defined(TARGET_MCU_NRF51822) - -#include "mbed_toolchain.h" - - -#define MAX_RTC_COUNTER_VAL ((1uL << RTC_COUNTER_BITS) - 1) - -/** - * The value previously set in the capture compare register of channel 1 - */ -static uint32_t previous_tick_cc_value = 0; - -/* - RTX provide the following definitions which are used by the tick code: - * os_trv: The number (minus 1) of clock cycle between two tick. - * os_clockrate: Time duration between two ticks (in us). - * OS_Tick_Handler: The function which handle a tick event. - This function is special because it never returns. - Those definitions are used by the code which handle the os tick. - To allow compilation of us_ticker programs without RTOS, those symbols are - exported from this module as weak ones. - */ -MBED_WEAK uint32_t const os_trv; -MBED_WEAK uint32_t const os_clockrate; -MBED_WEAK void OS_Tick_Handler(void) -{ -} - - -#if defined (__CC_ARM) /* ARMCC Compiler */ - -__asm void COMMON_RTC_IRQ_HANDLER(void) -{ - IMPORT OS_Tick_Handler - IMPORT common_rtc_irq_handler - - /** - * Chanel 1 of RTC1 is used by RTX as a systick. - * If the compare event on channel 1 is set, then branch to OS_Tick_Handler. - * Otherwise, just execute common_rtc_irq_handler. - * This function has to be written in assembly and tagged as naked because OS_Tick_Handler - * will never return. - * A c function would put lr on the stack before calling OS_Tick_Handler and this value - * would never been dequeued. - * - * \code - * void COMMON_RTC_IRQ_HANDLER(void) { - if(NRF_RTC1->EVENTS_COMPARE[1]) { - // never return... - OS_Tick_Handler(); - } else { - common_rtc_irq_handler(); - } - } - * \endcode - */ - ldr r0,=0x40011144 - ldr r1, [r0, #0] - cmp r1, #0 - beq US_TICKER_HANDLER - bl OS_Tick_Handler -US_TICKER_HANDLER - push {r3, lr} - bl common_rtc_irq_handler - pop {r3, pc} - ; ALIGN ; -} - -#elif defined (__GNUC__) /* GNU Compiler */ - -__attribute__((naked)) void COMMON_RTC_IRQ_HANDLER(void) -{ - /** - * Chanel 1 of RTC1 is used by RTX as a systick. - * If the compare event on channel 1 is set, then branch to OS_Tick_Handler. - * Otherwise, just execute common_rtc_irq_handler. - * This function has to be written in assembly and tagged as naked because OS_Tick_Handler - * will never return. - * A c function would put lr on the stack before calling OS_Tick_Handler and this value - * would never been dequeued. - * - * \code - * void COMMON_RTC_IRQ_HANDLER(void) { - if(NRF_RTC1->EVENTS_COMPARE[1]) { - // never return... - OS_Tick_Handler(); - } else { - common_rtc_irq_handler(); - } - } - * \endcode - */ - __asm__ ( - "ldr r0,=0x40011144\n" - "ldr r1, [r0, #0]\n" - "cmp r1, #0\n" - "beq US_TICKER_HANDLER\n" - "bl OS_Tick_Handler\n" - "US_TICKER_HANDLER:\n" - "push {r3, lr}\n" - "bl common_rtc_irq_handler\n" - "pop {r3, pc}\n" - "nop" - ); -} - -#elif defined (__ICCARM__)//IAR -void common_rtc_irq_handler(void); - -__stackless __task void COMMON_RTC_IRQ_HANDLER(void) -{ - uint32_t temp; - - __asm volatile( - " ldr %[temp], [%[reg2check]] \n" - " cmp %[temp], #0 \n" - " beq 1f \n" - " bl.w OS_Tick_Handler \n" - "1: \n" - " push {r3, lr}\n" - " blx %[rtc_irq] \n" - " pop {r3, pc}\n" - - : /* Outputs */ - [temp] "=&r"(temp) - : /* Inputs */ - [reg2check] "r"(0x40011144), - [rtc_irq] "r"(common_rtc_irq_handler) - : /* Clobbers */ - "cc" - ); - (void)temp; -} - - -#else - -#error Compiler not supported. -#error Provide a definition of COMMON_RTC_IRQ_HANDLER. - -/* - * Chanel 1 of RTC1 is used by RTX as a systick. - * If the compare event on channel 1 is set, then branch to OS_Tick_Handler. - * Otherwise, just execute common_rtc_irq_handler. - * This function has to be written in assembly and tagged as naked because OS_Tick_Handler - * will never return. - * A c function would put lr on the stack before calling OS_Tick_Handler and this value - * will never been dequeued. After a certain time a stack overflow will happen. - * - * \code - * void COMMON_RTC_IRQ_HANDLER(void) { - if(NRF_RTC1->EVENTS_COMPARE[1]) { - // never return... - OS_Tick_Handler(); - } else { - common_rtc_irq_handler(); - } - } - * \endcode - */ - -#endif - -/** - * Return the next number of clock cycle needed for the next tick. - * @note This function has been carrefuly optimized for a systick occuring every 1000us. - */ -static uint32_t get_next_tick_cc_delta() -{ - uint32_t delta = 0; - - if (os_clockrate != 1000) { - // In RTX, by default SYSTICK is is used. - // A tick event is generated every os_trv + 1 clock cycles of the system timer. - delta = os_trv + 1; - } else { - // If the clockrate is set to 1000us then 1000 tick should happen every second. - // Unfortunatelly, when clockrate is set to 1000, os_trv is equal to 31. - // If (os_trv + 1) is used as the delta value between two ticks, 1000 ticks will be - // generated in 32000 clock cycle instead of 32768 clock cycles. - // As a result, if a user schedule an OS timer to start in 100s, the timer will start - // instead after 97.656s - // The code below fix this issue, a clock rate of 1000s will generate 1000 ticks in 32768 - // clock cycles. - // The strategy is simple, for 1000 ticks: - // * 768 ticks will occur 33 clock cycles after the previous tick - // * 232 ticks will occur 32 clock cycles after the previous tick - // By default every delta is equal to 33. - // Every five ticks (20%, 200 delta in one second), the delta is equal to 32 - // The remaining (32) deltas equal to 32 are distributed using primes numbers. - static uint32_t counter = 0; - if ((counter % 5) == 0 || (counter % 31) == 0 || (counter % 139) == 0 || (counter == 503)) { - delta = 32; - } else { - delta = 33; - } - ++counter; - if (counter == 1000) { - counter = 0; - } - } - return delta; -} - -static inline void clear_tick_interrupt() -{ - nrf_rtc_event_clear(COMMON_RTC_INSTANCE, OS_TICK_EVENT); - nrf_rtc_event_disable(COMMON_RTC_INSTANCE, OS_TICK_INT_MASK); -} - -/** - * Indicate if a value is included in a range which can be wrapped. - * @param begin start of the range - * @param end end of the range - * @param val value to check - * @return true if the value is included in the range and false otherwise. - */ -static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t val) -{ - // regular case, begin < end - // return true if begin <= val < end - if (begin < end) { - if (begin <= val && val < end) { - return true; - } else { - return false; - } - } else { - // In this case end < begin because it has wrap around the limits - // return false if end < val < begin - if (end < val && val < begin) { - return false; - } else { - return true; - } - } - -} - -/** - * Register the next tick. - */ -static void register_next_tick() -{ - previous_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL); - uint32_t delta = get_next_tick_cc_delta(); - uint32_t new_compare_value = (previous_tick_cc_value + delta) & MAX_RTC_COUNTER_VAL; - - // Disable irq directly for few cycles, - // Validation of the new CC value against the COUNTER, - // Setting the new CC value and enabling CC IRQ should be an atomic operation - // Otherwise, there is a possibility to set an invalid CC value because - // the RTC1 keeps running. - // This code is very short 20-38 cycles in the worst case, it shouldn't - // disturb softdevice. - core_util_critical_section_enter(); - uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); - - // If an overflow occur, set the next tick in COUNTER + delta clock cycles - if (is_in_wrapped_range(previous_tick_cc_value, new_compare_value, current_counter + 1) == false) { - new_compare_value = current_counter + delta; - } - nrf_rtc_cc_set(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL, new_compare_value); - // Enable generation of the compare event for the value set above (this - // event will trigger the interrupt). - nrf_rtc_event_enable(COMMON_RTC_INSTANCE, OS_TICK_INT_MASK); - core_util_critical_section_exit(); -} - -/** - * Initialize alternative hardware timer as RTX kernel timer - * This function is directly called by RTX. - * @note this function shouldn't be called directly. - * @return IRQ number of the alternative hardware timer - */ -int os_tick_init (void) -{ - common_rtc_init(); - nrf_rtc_int_enable(COMMON_RTC_INSTANCE, OS_TICK_INT_MASK); - - nrf_rtc_cc_set(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL, 0); - register_next_tick(); - - return nrf_drv_get_IRQn(COMMON_RTC_INSTANCE); -} - -/** - * Acknowledge the tick interrupt. - * This function is called by the function OS_Tick_Handler of RTX. - * @note this function shouldn't be called directly. - */ -void os_tick_irqack(void) -{ - clear_tick_interrupt(); - register_next_tick(); -} - -/** - * Returns the overflow flag of the alternative hardware timer. - * @note This function is exposed by RTX kernel. - * @return 1 if the timer has overflowed and 0 otherwise. - */ -uint32_t os_tick_ovf(void) -{ - uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); - uint32_t next_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL); - - return is_in_wrapped_range(previous_tick_cc_value, next_tick_cc_value, current_counter) ? 0 : 1; -} - -/** - * Return the value of the alternative hardware timer. - * @note The documentation is not very clear about what is expected as a result, - * is it an ascending counter, a descending one ? - * None of this is specified. - * The default systick is a descending counter and this function return values in - * descending order, even if the internal counter used is an ascending one. - * @return the value of the alternative hardware timer. - */ -uint32_t os_tick_val(void) -{ - uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); - uint32_t next_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL); - - // do not use os_tick_ovf because its counter value can be different - if(is_in_wrapped_range(previous_tick_cc_value, next_tick_cc_value, current_counter)) { - if (next_tick_cc_value > previous_tick_cc_value) { - return next_tick_cc_value - current_counter; - } else if(current_counter <= next_tick_cc_value) { - return next_tick_cc_value - current_counter; - } else { - return next_tick_cc_value + (MAX_RTC_COUNTER_VAL - current_counter); - } - } else { - // use (os_trv + 1) has the base step, can be totally inacurate ... - uint32_t clock_cycles_by_tick = os_trv + 1; - - // if current counter has wrap arround, add the limit to it. - if (current_counter < next_tick_cc_value) { - current_counter = current_counter + MAX_RTC_COUNTER_VAL; - } - - return clock_cycles_by_tick - ((current_counter - next_tick_cc_value) % clock_cycles_by_tick); - } - -} - -#endif // defined(TARGET_MCU_NRF51822) diff --git a/targets/targets.json b/targets/targets.json index b4cf770ae0d..0315570c88a 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -2542,7 +2542,7 @@ "TARGET_MCU_NRF51822" ], "MERGE_BOOTLOADER": false, - "extra_labels": ["NORDIC", "MCU_NRF51", "MCU_NRF51822_UNIFIED", "NRF5"], + "extra_labels": ["NORDIC", "MCU_NRF51", "MCU_NRF51822_UNIFIED", "NRF5", "SDK11"], "OUTPUT_EXT": "hex", "is_disk_virtual": true, "supported_toolchains": ["ARM", "GCC_ARM", "IAR"], @@ -2598,7 +2598,7 @@ "inherits": ["Target"], "core": "Cortex-M4F", "macros": ["NRF52", "TARGET_NRF52832", "BLE_STACK_SUPPORT_REQD", "SOFTDEVICE_PRESENT", "S132"], - "extra_labels": ["NORDIC", "MCU_NRF52", "MCU_NRF52832", "NRF5"], + "extra_labels": ["NORDIC", "MCU_NRF52", "MCU_NRF52832", "NRF5", "SDK11"], "OUTPUT_EXT": "hex", "is_disk_virtual": true, "supported_toolchains": ["GCC_ARM", "ARM", "IAR"], @@ -2678,7 +2678,7 @@ "inherits": ["Target"], "core": "Cortex-M4F", "macros": ["TARGET_NRF52840", "BLE_STACK_SUPPORT_REQD", "SOFTDEVICE_PRESENT", "S140", "NRF_SD_BLE_API_VERSION=5", "NRF52840_XXAA", "NRF_DFU_SETTINGS_VERSION=1", "NRF_SD_BLE_API_VERSION=5"], - "extra_labels": ["NORDIC", "MCU_NRF52840", "NRF5_SDK13"], + "extra_labels": ["NORDIC", "MCU_NRF52840", "NRF5", "SDK13"], "OUTPUT_EXT": "hex", "is_disk_virtual": true, "supported_toolchains": ["GCC_ARM", "ARM", "IAR"],