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 ant_stack_handler_types Types definitions for ANT 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 ANT stack support. These
yihui 1:fc2f9d636751 19 * types will be defined when the preprocessor define ANT_STACK_SUPPORT_REQD is defined.
yihui 1:fc2f9d636751 20 */
yihui 1:fc2f9d636751 21
yihui 1:fc2f9d636751 22 #ifndef ANT_STACK_HANDLER_TYPES_H__
yihui 1:fc2f9d636751 23 #define ANT_STACK_HANDLER_TYPES_H__
yihui 1:fc2f9d636751 24
yihui 1:fc2f9d636751 25 #ifdef ANT_STACK_SUPPORT_REQD
yihui 1:fc2f9d636751 26
yihui 1:fc2f9d636751 27 #include <stdlib.h>
yihui 1:fc2f9d636751 28
yihui 1:fc2f9d636751 29 #define ANT_STACK_EVT_MSG_BUF_SIZE 32 /**< Size of ANT event message buffer. This will be provided to the SoftDevice while fetching an event. */
yihui 1:fc2f9d636751 30 #define ANT_STACK_EVT_STRUCT_SIZE (sizeof(ant_evt_t)) /**< Size of the @ref ant_evt_t structure. This will be used by the @ref softdevice_handler to internal event buffer size needed. */
yihui 1:fc2f9d636751 31
yihui 1:fc2f9d636751 32 /**@brief ANT stack event type. */
yihui 1:fc2f9d636751 33 typedef struct
yihui 1:fc2f9d636751 34 {
yihui 1:fc2f9d636751 35 uint8_t channel; /**< Channel number. */
yihui 1:fc2f9d636751 36 uint8_t event; /**< Event code. */
yihui 1:fc2f9d636751 37 uint8_t evt_buffer[ANT_STACK_EVT_MSG_BUF_SIZE]; /**< Event message buffer. */
yihui 1:fc2f9d636751 38 } ant_evt_t;
yihui 1:fc2f9d636751 39
yihui 1:fc2f9d636751 40 /**@brief Application ANT stack event handler type. */
yihui 1:fc2f9d636751 41 typedef void (*ant_evt_handler_t) (ant_evt_t * p_ant_evt);
yihui 1:fc2f9d636751 42
yihui 1:fc2f9d636751 43 /**@brief Function for registering for ANT events.
yihui 1:fc2f9d636751 44 *
yihui 1:fc2f9d636751 45 * @details The application should use this function to register for receiving ANT events from
yihui 1:fc2f9d636751 46 * the SoftDevice. If the application does not call this function, then any ANT event
yihui 1:fc2f9d636751 47 * that may be generated by the SoftDevice will NOT be fetched. Once the application has
yihui 1:fc2f9d636751 48 * registered for the events, it is not possible to possible to cancel the registration.
yihui 1:fc2f9d636751 49 * However, it is possible to register a different function for handling the events at
yihui 1:fc2f9d636751 50 * any point of time.
yihui 1:fc2f9d636751 51 *
yihui 1:fc2f9d636751 52 * @param[in] ant_evt_handler Function to be called for each received ANT event.
yihui 1:fc2f9d636751 53 *
yihui 1:fc2f9d636751 54 * @retval NRF_SUCCESS Successful registration.
yihui 1:fc2f9d636751 55 * @retval NRF_ERROR_NULL Null pointer provided as input.
yihui 1:fc2f9d636751 56 */
yihui 1:fc2f9d636751 57 uint32_t softdevice_ant_evt_handler_set(ant_evt_handler_t ant_evt_handler);
yihui 1:fc2f9d636751 58
yihui 1:fc2f9d636751 59 #else
yihui 1:fc2f9d636751 60
yihui 1:fc2f9d636751 61 // The ANT Stack support is not required.
yihui 1:fc2f9d636751 62
yihui 1:fc2f9d636751 63 #define ANT_STACK_EVT_STRUCT_SIZE 0 /**< Since the ANT 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 ANT events.*/
yihui 1:fc2f9d636751 64
yihui 1:fc2f9d636751 65 #endif // ANT_STACK_SUPPORT_REQD
yihui 1:fc2f9d636751 66
yihui 1:fc2f9d636751 67 #endif // ANT_STACK_HANDLER_TYPES_H__
yihui 1:fc2f9d636751 68
yihui 1:fc2f9d636751 69 /** @} */