To get started with Seeed Tiny BLE, include detecting motion, button and battery level.

Dependencies:   BLE_API eMPL_MPU6050 mbed nRF51822

Committer:
yihui
Date:
Wed Apr 22 07:47:17 2015 +0000
Revision:
1:fc2f9d636751
update libraries; ; delete nRF51822/nordic-sdk/components/gpiote/app_gpiote.c to solve GPIOTE_IRQHandler multiply defined issue. temperarily change nRF51822 library to folder

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 1:fc2f9d636751 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
yihui 1:fc2f9d636751 2 *
yihui 1:fc2f9d636751 3 * The information contained herein is property of Nordic Semiconductor ASA.
yihui 1:fc2f9d636751 4 * Terms and conditions of usage are described in detail in NORDIC
yihui 1:fc2f9d636751 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
yihui 1:fc2f9d636751 6 *
yihui 1:fc2f9d636751 7 * Licensees are granted free, non-transferable use of the information. NO
yihui 1:fc2f9d636751 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
yihui 1:fc2f9d636751 9 * the file.
yihui 1:fc2f9d636751 10 *
yihui 1:fc2f9d636751 11 */
yihui 1:fc2f9d636751 12
yihui 1:fc2f9d636751 13 /**@file
yihui 1:fc2f9d636751 14 *
yihui 1:fc2f9d636751 15 * @defgroup ble_stack_handler_types Types definitions for BLE support in SoftDevice handler.
yihui 1:fc2f9d636751 16 * @{
yihui 1:fc2f9d636751 17 * @ingroup softdevice_handler
yihui 1:fc2f9d636751 18 * @brief This file contains the declarations of types required for BLE stack support. These
yihui 1:fc2f9d636751 19 * types will be defined when the preprocessor define BLE_STACK_SUPPORT_REQD is defined.
yihui 1:fc2f9d636751 20 */
yihui 1:fc2f9d636751 21
yihui 1:fc2f9d636751 22 #ifndef BLE_STACK_HANDLER_TYPES_H__
yihui 1:fc2f9d636751 23 #define BLE_STACK_HANDLER_TYPES_H__
yihui 1:fc2f9d636751 24
yihui 1:fc2f9d636751 25 #define BLE_STACK_SUPPORT_REQD
yihui 1:fc2f9d636751 26
yihui 1:fc2f9d636751 27 #ifdef BLE_STACK_SUPPORT_REQD
yihui 1:fc2f9d636751 28
yihui 1:fc2f9d636751 29 #include <stdlib.h>
yihui 1:fc2f9d636751 30 #include "ble.h"
yihui 1:fc2f9d636751 31 #include "nrf_sdm.h"
yihui 1:fc2f9d636751 32 #include "app_error.h"
yihui 1:fc2f9d636751 33 #include "app_scheduler.h"
yihui 1:fc2f9d636751 34 #include "app_util.h"
yihui 1:fc2f9d636751 35
yihui 1:fc2f9d636751 36 #ifdef __cplusplus
yihui 1:fc2f9d636751 37 extern "C" {
yihui 1:fc2f9d636751 38 #endif // #ifdef __cplusplus
yihui 1:fc2f9d636751 39
yihui 1:fc2f9d636751 40 #define BLE_STACK_EVT_MSG_BUF_SIZE (sizeof(ble_evt_t) + (GATT_MTU_SIZE_DEFAULT)) /**< Size of BLE event message buffer. This will be provided to the SoftDevice while fetching an event. */
yihui 1:fc2f9d636751 41 #define BLE_STACK_HANDLER_SCHED_EVT_SIZE 0 /**< The size of the scheduler event used by SoftDevice handler when passing BLE events using the @ref app_scheduler. */
yihui 1:fc2f9d636751 42
yihui 1:fc2f9d636751 43 /**@brief Application stack event handler type. */
yihui 1:fc2f9d636751 44 typedef void (*ble_evt_handler_t) (ble_evt_t * p_ble_evt);
yihui 1:fc2f9d636751 45
yihui 1:fc2f9d636751 46 /**@brief Function for registering for BLE events.
yihui 1:fc2f9d636751 47 *
yihui 1:fc2f9d636751 48 * @details The application should use this function to register for receiving BLE events from
yihui 1:fc2f9d636751 49 * the SoftDevice. If the application does not call this function, then any BLE event
yihui 1:fc2f9d636751 50 * that may be generated by the SoftDevice will NOT be fetched. Once the application has
yihui 1:fc2f9d636751 51 * registered for the events, it is not possible to cancel the registration.
yihui 1:fc2f9d636751 52 * However, it is possible to register a different function for handling the events at
yihui 1:fc2f9d636751 53 * any point of time.
yihui 1:fc2f9d636751 54 *
yihui 1:fc2f9d636751 55 * @param[in] ble_evt_handler Function to be called for each received BLE event.
yihui 1:fc2f9d636751 56 *
yihui 1:fc2f9d636751 57 * @retval NRF_SUCCESS Successful registration.
yihui 1:fc2f9d636751 58 * @retval NRF_ERROR_NULL Null pointer provided as input.
yihui 1:fc2f9d636751 59 */
yihui 1:fc2f9d636751 60 uint32_t softdevice_ble_evt_handler_set(ble_evt_handler_t ble_evt_handler);
yihui 1:fc2f9d636751 61
yihui 1:fc2f9d636751 62 #ifdef __cplusplus
yihui 1:fc2f9d636751 63 }
yihui 1:fc2f9d636751 64 #endif // #ifdef __cplusplus
yihui 1:fc2f9d636751 65
yihui 1:fc2f9d636751 66 #else
yihui 1:fc2f9d636751 67
yihui 1:fc2f9d636751 68 #define BLE_STACK_EVT_MSG_BUF_SIZE 0 /**< Since the BLE stack support is not required, this is equated to 0, so that the @ref softdevice_handler.h can compute the internal event buffer size without having to care for BLE events.*/
yihui 1:fc2f9d636751 69 #define BLE_STACK_HANDLER_SCHED_EVT_SIZE 0
yihui 1:fc2f9d636751 70
yihui 1:fc2f9d636751 71 #endif // BLE_STACK_SUPPORT_REQD
yihui 1:fc2f9d636751 72
yihui 1:fc2f9d636751 73 #endif // BLE_STACK_HANDLER_TYPES_H__
yihui 1:fc2f9d636751 74
yihui 1:fc2f9d636751 75 /** @} */