cvb
Fork of nrf51-sdk by
source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.h@9:d3dd910b0f4b, 2018-08-14 (annotated)
- Committer:
- tb942
- Date:
- Tue Aug 14 18:27:20 2018 +0000
- Revision:
- 9:d3dd910b0f4b
- Parent:
- 0:bc2961fa1ef0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jonathan Austin |
0:bc2961fa1ef0 | 1 | /* |
Jonathan Austin |
0:bc2961fa1ef0 | 2 | * Copyright (c) Nordic Semiconductor ASA |
Jonathan Austin |
0:bc2961fa1ef0 | 3 | * All rights reserved. |
Jonathan Austin |
0:bc2961fa1ef0 | 4 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Jonathan Austin |
0:bc2961fa1ef0 | 6 | * are permitted provided that the following conditions are met: |
Jonathan Austin |
0:bc2961fa1ef0 | 7 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 8 | * 1. Redistributions of source code must retain the above copyright notice, this |
Jonathan Austin |
0:bc2961fa1ef0 | 9 | * list of conditions and the following disclaimer. |
Jonathan Austin |
0:bc2961fa1ef0 | 10 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this |
Jonathan Austin |
0:bc2961fa1ef0 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
Jonathan Austin |
0:bc2961fa1ef0 | 13 | * other materials provided with the distribution. |
Jonathan Austin |
0:bc2961fa1ef0 | 14 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 15 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of other |
Jonathan Austin |
0:bc2961fa1ef0 | 16 | * contributors to this software may be used to endorse or promote products |
Jonathan Austin |
0:bc2961fa1ef0 | 17 | * derived from this software without specific prior written permission. |
Jonathan Austin |
0:bc2961fa1ef0 | 18 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 19 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Jonathan Austin |
0:bc2961fa1ef0 | 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Jonathan Austin |
0:bc2961fa1ef0 | 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Jonathan Austin |
0:bc2961fa1ef0 | 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Jonathan Austin |
0:bc2961fa1ef0 | 24 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Jonathan Austin |
0:bc2961fa1ef0 | 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Jonathan Austin |
0:bc2961fa1ef0 | 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Jonathan Austin |
0:bc2961fa1ef0 | 27 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Jonathan Austin |
0:bc2961fa1ef0 | 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Jonathan Austin |
0:bc2961fa1ef0 | 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Jonathan Austin |
0:bc2961fa1ef0 | 30 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 31 | */ |
Jonathan Austin |
0:bc2961fa1ef0 | 32 | |
Jonathan Austin |
0:bc2961fa1ef0 | 33 | /** @file |
Jonathan Austin |
0:bc2961fa1ef0 | 34 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 35 | * @defgroup ble_radio_notification Radio Notification Event Handler |
Jonathan Austin |
0:bc2961fa1ef0 | 36 | * @{ |
Jonathan Austin |
0:bc2961fa1ef0 | 37 | * @ingroup ble_sdk_lib |
Jonathan Austin |
0:bc2961fa1ef0 | 38 | * @brief Module for propagating Radio Notification events to the application. |
Jonathan Austin |
0:bc2961fa1ef0 | 39 | */ |
Jonathan Austin |
0:bc2961fa1ef0 | 40 | |
Jonathan Austin |
0:bc2961fa1ef0 | 41 | #ifndef BLE_RADIO_NOTIFICATION_H__ |
Jonathan Austin |
0:bc2961fa1ef0 | 42 | #define BLE_RADIO_NOTIFICATION_H__ |
Jonathan Austin |
0:bc2961fa1ef0 | 43 | |
Jonathan Austin |
0:bc2961fa1ef0 | 44 | #include <stdint.h> |
Jonathan Austin |
0:bc2961fa1ef0 | 45 | #include <stdbool.h> |
Jonathan Austin |
0:bc2961fa1ef0 | 46 | #include "nrf_soc.h" |
Jonathan Austin |
0:bc2961fa1ef0 | 47 | |
Jonathan Austin |
0:bc2961fa1ef0 | 48 | /**@brief Application radio notification event handler type. */ |
Jonathan Austin |
0:bc2961fa1ef0 | 49 | typedef void (*ble_radio_notification_evt_handler_t) (bool radio_active); |
Jonathan Austin |
0:bc2961fa1ef0 | 50 | |
Jonathan Austin |
0:bc2961fa1ef0 | 51 | /**@brief Function for initializing the Radio Notification module. |
Jonathan Austin |
0:bc2961fa1ef0 | 52 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 53 | * @param[in] irq_priority Interrupt priority for the Radio Notification interrupt handler. |
Jonathan Austin |
0:bc2961fa1ef0 | 54 | * @param[in] distance The time from an Active event until the radio is activated. |
Jonathan Austin |
0:bc2961fa1ef0 | 55 | * @param[in] evt_handler Handler to be executed when a radio notification event has been |
Jonathan Austin |
0:bc2961fa1ef0 | 56 | * received. |
Jonathan Austin |
0:bc2961fa1ef0 | 57 | * |
Jonathan Austin |
0:bc2961fa1ef0 | 58 | * @return NRF_SUCCESS on successful initialization, otherwise an error code. |
Jonathan Austin |
0:bc2961fa1ef0 | 59 | */ |
Jonathan Austin |
0:bc2961fa1ef0 | 60 | uint32_t ble_radio_notification_init(nrf_app_irq_priority_t irq_priority, |
Jonathan Austin |
0:bc2961fa1ef0 | 61 | nrf_radio_notification_distance_t distance, |
Jonathan Austin |
0:bc2961fa1ef0 | 62 | ble_radio_notification_evt_handler_t evt_handler); |
Jonathan Austin |
0:bc2961fa1ef0 | 63 | |
Jonathan Austin |
0:bc2961fa1ef0 | 64 | #endif // BLE_RADIO_NOTIFICATION_H__ |
Jonathan Austin |
0:bc2961fa1ef0 | 65 | |
Jonathan Austin |
0:bc2961fa1ef0 | 66 | /** @} */ |