テスト用です。

Dependencies:   mbed

Committer:
jksoft
Date:
Tue Oct 11 11:09:42 2016 +0000
Revision:
0:8468a4403fea
SB??ver;

Who changed what in which revision?

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