HW layer for the Nucleo board, it only work with old BLE_API
Dependents: Hello_BLE F446RE-BLE
Fork of X_NUCLEO_IDB0XA1 by
Diff: BlueNRGDevice.cpp
- Revision:
- 106:2176f8cfe5b3
- Parent:
- 105:332f93cd06b7
- Child:
- 107:5cc5ac5bfbbb
--- a/BlueNRGDevice.cpp Tue Aug 11 11:36:13 2015 +0200 +++ b/BlueNRGDevice.cpp Tue Aug 11 11:03:58 2015 +0000 @@ -55,17 +55,18 @@ /** * The singleton which represents the BlueNRG transport for the BLEDevice. +* FIXME: find a better way to create the BlueNRG device instance so that +* the pin names can be chosen by the users of this class * -* See file 'x_nucleo_idb0xa1_targets.h' for details regarding the peripheral pins used! +* This is using Arduino pins as follows: +* D11: MOSI line of SPI interface +* D12: MISO line of SPI interface +* D3 : SCK line of SPI interface +* A1 : nCS line of SPI interface +* D7 : BlueNRG reset +* A0 : BlueNRG IRQ pin */ -#include "x_nucleo_idb0xa1_targets.h" - -BlueNRGDevice bluenrgDeviceInstance(IDB0XA1_PIN_SPI_MOSI, - IDB0XA1_PIN_SPI_MISO, - IDB0XA1_PIN_SPI_SCK, - IDB0XA1_PIN_SPI_nCS, - IDB0XA1_PIN_SPI_RESET, - IDB0XA1_PIN_SPI_IRQ); +BlueNRGDevice bluenrgDeviceInstance(D11, D12, D3, A1, D7, A0); /** * BLE-API requires an implementation of the following function in order to @@ -126,7 +127,6 @@ ble_error_t BlueNRGDevice::init(void) { // Set the interrupt handler for the device - irq_.mode(PullNone); // betzw: set irq mode irq_.rise(&HCI_Isr); /* ToDo: Clear memory contents, reset the SD, etc. */