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

Dependents:   nRF51822 nRF51822

Committer:
vcoubard
Date:
Thu Apr 07 17:37:40 2016 +0100
Revision:
19:47192cb9def7
Parent:
10:233fefd8162b
Child:
20:a90c48eb1d30
Synchronized with git rev 9251259f
Author: Liyou Zhou
Copy over coresponding files from nordic-sdk 9.0.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vcoubard 19:47192cb9def7 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
vcoubard 19:47192cb9def7 2 *
vcoubard 19:47192cb9def7 3 * The information contained herein is property of Nordic Semiconductor ASA.
vcoubard 19:47192cb9def7 4 * Terms and conditions of usage are described in detail in NORDIC
vcoubard 19:47192cb9def7 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
vcoubard 19:47192cb9def7 6 *
vcoubard 19:47192cb9def7 7 * Licensees are granted free, non-transferable use of the information. NO
vcoubard 19:47192cb9def7 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
vcoubard 19:47192cb9def7 9 * the file.
vcoubard 19:47192cb9def7 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 ant_stack_handler_types Types definitions for ANT 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 ANT stack support. These
Vincent Coubard 0:f2542974c862 19 * types will be defined when the preprocessor define ANT_STACK_SUPPORT_REQD is defined.
Vincent Coubard 0:f2542974c862 20 */
Vincent Coubard 0:f2542974c862 21
Vincent Coubard 0:f2542974c862 22 #ifndef ANT_STACK_HANDLER_TYPES_H__
Vincent Coubard 0:f2542974c862 23 #define ANT_STACK_HANDLER_TYPES_H__
Vincent Coubard 0:f2542974c862 24
Vincent Coubard 0:f2542974c862 25 #ifdef ANT_STACK_SUPPORT_REQD
Vincent Coubard 0:f2542974c862 26
Vincent Coubard 0:f2542974c862 27 #include <stdlib.h>
Vincent Coubard 0:f2542974c862 28
Vincent Coubard 0:f2542974c862 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. */
Vincent Coubard 0:f2542974c862 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. */
Vincent Coubard 0:f2542974c862 31
Vincent Coubard 0:f2542974c862 32 /**@brief ANT stack event type. */
Vincent Coubard 0:f2542974c862 33 typedef struct
Vincent Coubard 0:f2542974c862 34 {
Vincent Coubard 0:f2542974c862 35 uint8_t channel; /**< Channel number. */
Vincent Coubard 0:f2542974c862 36 uint8_t event; /**< Event code. */
Vincent Coubard 0:f2542974c862 37 uint8_t evt_buffer[ANT_STACK_EVT_MSG_BUF_SIZE]; /**< Event message buffer. */
Vincent Coubard 0:f2542974c862 38 } ant_evt_t;
Vincent Coubard 0:f2542974c862 39
Vincent Coubard 0:f2542974c862 40 /**@brief Application ANT stack event handler type. */
Vincent Coubard 0:f2542974c862 41 typedef void (*ant_evt_handler_t) (ant_evt_t * p_ant_evt);
Vincent Coubard 0:f2542974c862 42
Vincent Coubard 0:f2542974c862 43 /**@brief Function for registering for ANT events.
Vincent Coubard 0:f2542974c862 44 *
Vincent Coubard 0:f2542974c862 45 * @details The application should use this function to register for receiving ANT events from
Vincent Coubard 0:f2542974c862 46 * the SoftDevice. If the application does not call this function, then any ANT event
Vincent Coubard 0:f2542974c862 47 * that may be generated by the SoftDevice will NOT be fetched. Once the application has
Vincent Coubard 0:f2542974c862 48 * registered for the events, it is not possible to possible to cancel the registration.
Vincent Coubard 0:f2542974c862 49 * However, it is possible to register a different function for handling the events at
Vincent Coubard 0:f2542974c862 50 * any point of time.
Vincent Coubard 0:f2542974c862 51 *
Vincent Coubard 0:f2542974c862 52 * @param[in] ant_evt_handler Function to be called for each received ANT event.
Vincent Coubard 0:f2542974c862 53 *
Vincent Coubard 0:f2542974c862 54 * @retval NRF_SUCCESS Successful registration.
Vincent Coubard 0:f2542974c862 55 * @retval NRF_ERROR_NULL Null pointer provided as input.
Vincent Coubard 0:f2542974c862 56 */
Vincent Coubard 0:f2542974c862 57 uint32_t softdevice_ant_evt_handler_set(ant_evt_handler_t ant_evt_handler);
Vincent Coubard 0:f2542974c862 58
Vincent Coubard 0:f2542974c862 59 #else
Vincent Coubard 0:f2542974c862 60
Vincent Coubard 0:f2542974c862 61 // The ANT Stack support is not required.
Vincent Coubard 0:f2542974c862 62
Vincent Coubard 0:f2542974c862 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.*/
Vincent Coubard 0:f2542974c862 64
Vincent Coubard 0:f2542974c862 65 #endif // ANT_STACK_SUPPORT_REQD
Vincent Coubard 0:f2542974c862 66
Vincent Coubard 0:f2542974c862 67 #endif // ANT_STACK_HANDLER_TYPES_H__
Vincent Coubard 0:f2542974c862 68
vcoubard 1:ebc0e0ef0a11 69 /** @} */