BLE_API wrapper library for STMicroelectronics' BlueNRG Bluetooth Low Energy expansion board shield (Component)

Dependents:   Nucleo_Zumo_BLE_IDB04A1 contest_IOT5 contest_IOT6 contest_IOT_10 ... more

Fork of X_NUCLEO_IDB0XA1 by ST Expansion SW Team

Arduino Connector Compatibility Warning

X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 are Arduino compatible with an exception: instead of using pin D13 for the SPI clock, they use pin D3. The default configuration for this library is having the SPI clock on pin D3.

To be fully Arduino compatible, X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 need a small HW patch.

For X-NUCLEO-IDB04A1 this patch consists in removing zero resistor R10 and instead soldering zero resistor R11. For X-NUCLEO-IDB05A1 this patch consists in removing zero resistor R4 and instead soldering zero resistor R6.

In case you patch your board, then you also have to configure this library to use pin D13 to drive the SPI clock (see macro IDB0XA1_D13_PATCH in file x_nucleo_idb0xa1_targets.h).

If you use pin D13 for the SPI clock, please be aware that on STM32 Nucleo boards you may not drive the LED, otherwise you will get a conflict: the LED on STM32 Nucleo boards is connected to pin D13.

Referring to the current list of tested platforms (see X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 pages), the patch is required by ST-Nucleo-F103RB; ST-Nucleo-F302R8; ST-Nucleo-F411RE; and ST-Nucleo-F446RE.

Committer:
Andrea Palmieri
Date:
Fri Sep 16 12:03:25 2016 +0200
Revision:
307:fa98703ece8e
Parent:
289:980efe0d2975
Sync with 21bfd161ace255bb6214d6b74cae1fd30b3e24c9

2016-09-16 11:53:47+02:00: Andrea Palmieri
Get rid of warnings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 132:51056160fa4a 1 /**
Wolfgang Betz 132:51056160fa4a 2 ******************************************************************************
Wolfgang Betz 132:51056160fa4a 3 * @file stm32_bluenrg_ble.h
Wolfgang Betz 132:51056160fa4a 4 * @author CL
Wolfgang Betz 132:51056160fa4a 5 * @version V1.0.1
Wolfgang Betz 132:51056160fa4a 6 * @date 15-June-2014
Wolfgang Betz 132:51056160fa4a 7 * @brief
Wolfgang Betz 132:51056160fa4a 8 ******************************************************************************
Wolfgang Betz 132:51056160fa4a 9 * @attention
Wolfgang Betz 132:51056160fa4a 10 *
Wolfgang Betz 132:51056160fa4a 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Wolfgang Betz 132:51056160fa4a 12 *
Wolfgang Betz 132:51056160fa4a 13 * Redistribution and use in source and binary forms, with or without modification,
Wolfgang Betz 132:51056160fa4a 14 * are permitted provided that the following conditions are met:
Wolfgang Betz 132:51056160fa4a 15 * 1. Redistributions of source code must retain the above copyright notice,
Wolfgang Betz 132:51056160fa4a 16 * this list of conditions and the following disclaimer.
Wolfgang Betz 132:51056160fa4a 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Wolfgang Betz 132:51056160fa4a 18 * this list of conditions and the following disclaimer in the documentation
Wolfgang Betz 132:51056160fa4a 19 * and/or other materials provided with the distribution.
Wolfgang Betz 132:51056160fa4a 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Wolfgang Betz 132:51056160fa4a 21 * may be used to endorse or promote products derived from this software
Wolfgang Betz 132:51056160fa4a 22 * without specific prior written permission.
Wolfgang Betz 132:51056160fa4a 23 *
Wolfgang Betz 132:51056160fa4a 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Wolfgang Betz 132:51056160fa4a 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Wolfgang Betz 132:51056160fa4a 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Wolfgang Betz 132:51056160fa4a 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Wolfgang Betz 132:51056160fa4a 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Wolfgang Betz 132:51056160fa4a 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Wolfgang Betz 132:51056160fa4a 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Wolfgang Betz 132:51056160fa4a 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Wolfgang Betz 132:51056160fa4a 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Wolfgang Betz 132:51056160fa4a 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Wolfgang Betz 132:51056160fa4a 34 *
Wolfgang Betz 132:51056160fa4a 35 ******************************************************************************
Wolfgang Betz 132:51056160fa4a 36 */
Wolfgang Betz 132:51056160fa4a 37
Wolfgang Betz 132:51056160fa4a 38 /* Define to prevent recursive inclusion -------------------------------------*/
Wolfgang Betz 132:51056160fa4a 39 #ifndef __STM32_BLUENRG_BLE_H
Wolfgang Betz 132:51056160fa4a 40 #define __STM32_BLUENRG_BLE_H
Wolfgang Betz 132:51056160fa4a 41
Wolfgang Betz 132:51056160fa4a 42 #ifdef __cplusplus
Wolfgang Betz 132:51056160fa4a 43 extern "C" {
Wolfgang Betz 132:51056160fa4a 44 #endif
Wolfgang Betz 132:51056160fa4a 45
Wolfgang Betz 132:51056160fa4a 46
Wolfgang Betz 132:51056160fa4a 47 #include <stdint.h>
Vincent Coubard 289:980efe0d2975 48 #include "ble_gp_timer.h"
Vincent Coubard 289:980efe0d2975 49 #include "ble_hal.h"
Wolfgang Betz 132:51056160fa4a 50
Wolfgang Betz 132:51056160fa4a 51 /** @addtogroup BSP
Wolfgang Betz 132:51056160fa4a 52 * @{
Wolfgang Betz 132:51056160fa4a 53 */
Wolfgang Betz 132:51056160fa4a 54
Wolfgang Betz 132:51056160fa4a 55 /** @addtogroup X-NUCLEO-IDB04A1
Wolfgang Betz 132:51056160fa4a 56 * @{
Wolfgang Betz 132:51056160fa4a 57 */
Wolfgang Betz 132:51056160fa4a 58
Wolfgang Betz 132:51056160fa4a 59 /** @addtogroup STM32_BLUENRG_BLE
Wolfgang Betz 132:51056160fa4a 60 * @{
Wolfgang Betz 132:51056160fa4a 61 */
Wolfgang Betz 132:51056160fa4a 62
Wolfgang Betz 132:51056160fa4a 63 /** @defgroup STM32_BLUENRG_BLE_Exported_Functions
Wolfgang Betz 132:51056160fa4a 64 * @{
Wolfgang Betz 132:51056160fa4a 65 */
Wolfgang Betz 132:51056160fa4a 66
Wolfgang Betz 132:51056160fa4a 67 // FIXME: add prototypes for BlueNRG here
Wolfgang Betz 132:51056160fa4a 68 void BlueNRG_RST(void);
Wolfgang Betz 132:51056160fa4a 69 uint8_t BlueNRG_DataPresent(void);
Wolfgang Betz 132:51056160fa4a 70 void BlueNRG_HW_Bootloader(void);
Wolfgang Betz 132:51056160fa4a 71 int32_t BlueNRG_SPI_Read_All(uint8_t *buffer,
Wolfgang Betz 132:51056160fa4a 72 uint8_t buff_size);
Wolfgang Betz 132:51056160fa4a 73 int32_t BlueNRG_SPI_Write(uint8_t* data1,
Wolfgang Betz 132:51056160fa4a 74 uint8_t* data2,
Wolfgang Betz 132:51056160fa4a 75 uint8_t Nb_bytes1,
Wolfgang Betz 132:51056160fa4a 76 uint8_t Nb_bytes2);
Wolfgang Betz 132:51056160fa4a 77 void Clear_SPI_EXTI_Flag(void);
Wolfgang Betz 132:51056160fa4a 78
Wolfgang Betz 132:51056160fa4a 79 void print_csv_time(void);
Wolfgang Betz 132:51056160fa4a 80
Wolfgang Betz 132:51056160fa4a 81 /**
Wolfgang Betz 132:51056160fa4a 82 * @}
Wolfgang Betz 132:51056160fa4a 83 */
Wolfgang Betz 132:51056160fa4a 84
Wolfgang Betz 132:51056160fa4a 85 /**
Wolfgang Betz 132:51056160fa4a 86 * @}
Wolfgang Betz 132:51056160fa4a 87 */
Wolfgang Betz 132:51056160fa4a 88
Wolfgang Betz 132:51056160fa4a 89 /**
Wolfgang Betz 132:51056160fa4a 90 * @}
Wolfgang Betz 132:51056160fa4a 91 */
Wolfgang Betz 132:51056160fa4a 92
Wolfgang Betz 132:51056160fa4a 93 /**
Wolfgang Betz 132:51056160fa4a 94 * @}
Wolfgang Betz 132:51056160fa4a 95 */
Wolfgang Betz 132:51056160fa4a 96
Wolfgang Betz 132:51056160fa4a 97 #ifdef __cplusplus
Wolfgang Betz 132:51056160fa4a 98 }
Wolfgang Betz 132:51056160fa4a 99 #endif
Wolfgang Betz 132:51056160fa4a 100
Wolfgang Betz 132:51056160fa4a 101 #endif /* __STM32_BLUENRG_BLE_H */
Wolfgang Betz 132:51056160fa4a 102
Wolfgang Betz 132:51056160fa4a 103 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/