Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.

Dependents:   nRF51822 nRF51822

Committer:
vcoubard
Date:
Thu Apr 07 17:37:19 2016 +0100
Revision:
3:6d535ccf2f48
Parent:
1:ebc0e0ef0a11
Child:
10:233fefd8162b
Synchronized with git rev e68b1f8c
Author: Liyou Zhou
Move defines from cmake files into noridc files
This requires changing of nordic source but do away with
magic defines in parent modules

note on #define asm __ASM
all yotta mobule compile with -std=c99 which does not
include "asm" keyword.

Who changed what in which revision?

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