-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the Simblee-Board #211
Open
PaulBrandt
wants to merge
3
commits into
sandeepmistry:master
Choose a base branch
from
PaulBrandt:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
// Copyright (c) Sandeep Mistry. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
#if defined(NRF51) || defined(NRF52) || defined(__RFduino__) | ||
#ifdef __Simblee__ // TODO: Is this actually correct? It's the only way this file compiles for me using the S110 V8 headers. | ||
#define NRF5 | ||
#define S110 | ||
#endif | ||
|
||
#if defined(NRF51) || defined(NRF52) || defined(__RFduino__) || defined(__Simblee__) | ||
|
||
#ifdef __RFduino__ | ||
#include <utility/RFduino/ble.h> | ||
#include <utility/RFduino/ble_hci.h> | ||
#include <utility/RFduino/nrf_sdm.h> | ||
#elif __Simblee__ | ||
#include <utility/Simblee/ble.h> | ||
#include <utility/Simblee/ble_hci.h> | ||
#include <utility/Simblee/nrf_sdm.h> | ||
#elif defined(NRF5) || defined(NRF51_S130) | ||
#include <ble.h> | ||
#include <ble_hci.h> | ||
|
@@ -99,7 +108,7 @@ void nRF51822::begin(unsigned char advertisementDataSize, | |
unsigned char numRemoteAttributes) | ||
{ | ||
|
||
#ifdef __RFduino__ | ||
#if defined(__RFduino__) || defined(__Simblee__) | ||
sd_softdevice_enable(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL); | ||
#elif defined(NRF5) && !defined(S110) | ||
#if defined(USE_LFRC) | ||
|
@@ -520,6 +529,8 @@ void nRF51822::begin(unsigned char advertisementDataSize, | |
|
||
#ifdef __RFduino__ | ||
RFduinoBLE_enabled = 1; | ||
#elif defined(__Simblee__) | ||
SimbleeBLE_enabled = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? |
||
#endif | ||
} | ||
|
||
|
@@ -1206,7 +1217,7 @@ bool nRF51822::writeRemoteCharacteristic(BLERemoteCharacteristic& characteristic | |
ble_gattc_write_params_t writeParams; | ||
|
||
writeParams.write_op = (this->_remoteCharacteristicInfo[i].properties.write) ? BLE_GATT_OP_WRITE_REQ : BLE_GATT_OP_WRITE_CMD; | ||
#ifndef __RFduino__ | ||
#if !defined(__RFduino__) && !defined(__Simblee__) | ||
writeParams.flags = 0; | ||
#endif | ||
writeParams.handle = this->_remoteCharacteristicInfo[i].valueHandle; | ||
|
@@ -1254,7 +1265,7 @@ bool nRF51822::subscribeRemoteCharacteristic(BLERemoteCharacteristic& characteri | |
uint16_t value = (this->_remoteCharacteristicInfo[i].properties.notify ? 0x0001 : 0x002); | ||
|
||
writeParams.write_op = BLE_GATT_OP_WRITE_REQ; | ||
#ifndef __RFduino__ | ||
#if !defined(__RFduino__) && !defined(__Simblee__) | ||
writeParams.flags = 0; | ||
#endif | ||
writeParams.handle = (this->_remoteCharacteristicInfo[i].valueHandle + 1); // don't discover descriptors for now | ||
|
@@ -1290,7 +1301,7 @@ bool nRF51822::unsubcribeRemoteCharacteristic(BLERemoteCharacteristic& character | |
uint16_t value = 0x0000; | ||
|
||
writeParams.write_op = BLE_GATT_OP_WRITE_REQ; | ||
#ifndef __RFduino__ | ||
#if !defined(__RFduino__) && !defined(__Simblee__) | ||
writeParams.flags = 0; | ||
#endif | ||
writeParams.handle = (this->_remoteCharacteristicInfo[i].valueHandle + 1); // don't discover descriptors for now | ||
|
@@ -1367,7 +1378,7 @@ void nRF51822::requestAddress() { | |
} | ||
|
||
void nRF51822::requestTemperature() { | ||
#ifndef __RFduino__ | ||
#if !defined(__RFduino__) && !defined(__Simblee__) | ||
int32_t rawTemperature = 0; | ||
|
||
sd_temp_get(&rawTemperature); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
It seems like the Simblee is using the S110_V8 Softdevice because these are the only headers, where I can find the peripheral device. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I'd recommend this, better to add the equivalents in future down in the file. In case the nRF5 core updates the S110 version.