Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Committer:
finneyj
Date:
Thu May 21 09:35:07 2015 +0000
Revision:
177:dad139e1e3c4
Parent:
106:7e1c66af835a
Disabled GPTIOE as it conflicts with mbed definitions.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 103:138bdc859cc9 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
rgrover1 103:138bdc859cc9 2 *
rgrover1 103:138bdc859cc9 3 * The information contained herein is property of Nordic Semiconductor ASA.
rgrover1 103:138bdc859cc9 4 * Terms and conditions of usage are described in detail in NORDIC
rgrover1 103:138bdc859cc9 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
rgrover1 103:138bdc859cc9 6 *
rgrover1 103:138bdc859cc9 7 * Licensees are granted free, non-transferable use of the information. NO
rgrover1 103:138bdc859cc9 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
rgrover1 103:138bdc859cc9 9 * the file.
rgrover1 103:138bdc859cc9 10 *
rgrover1 103:138bdc859cc9 11 */
rgrover1 103:138bdc859cc9 12
rgrover1 103:138bdc859cc9 13 /** @file
rgrover1 103:138bdc859cc9 14 *
rgrover1 103:138bdc859cc9 15 * @defgroup ble_sdk_lib_conn_params Connection Parameters Negotiation
rgrover1 103:138bdc859cc9 16 * @{
rgrover1 103:138bdc859cc9 17 * @ingroup ble_sdk_lib
rgrover1 103:138bdc859cc9 18 * @brief Module for initiating and executing a connection parameters negotiation procedure.
rgrover1 103:138bdc859cc9 19 */
rgrover1 103:138bdc859cc9 20
rgrover1 103:138bdc859cc9 21 #ifndef BLE_CONN_PARAMS_H__
rgrover1 103:138bdc859cc9 22 #define BLE_CONN_PARAMS_H__
rgrover1 103:138bdc859cc9 23
rgrover1 103:138bdc859cc9 24 #include <stdint.h>
rgrover1 103:138bdc859cc9 25 #include "ble.h"
rgrover1 103:138bdc859cc9 26 #include "ble_srv_common.h"
rgrover1 103:138bdc859cc9 27
rgrover1 104:55e59c802b7f 28 #ifdef __cplusplus
rgrover1 104:55e59c802b7f 29 extern "C" {
rgrover1 104:55e59c802b7f 30 #endif
rgrover1 104:55e59c802b7f 31
rgrover1 103:138bdc859cc9 32 /**@brief Connection Parameters Module event type. */
rgrover1 103:138bdc859cc9 33 typedef enum
rgrover1 103:138bdc859cc9 34 {
rgrover1 103:138bdc859cc9 35 BLE_CONN_PARAMS_EVT_FAILED , /**< Negotiation procedure failed. */
rgrover1 103:138bdc859cc9 36 BLE_CONN_PARAMS_EVT_SUCCEEDED /**< Negotiation procedure succeeded. */
rgrover1 103:138bdc859cc9 37 } ble_conn_params_evt_type_t;
rgrover1 103:138bdc859cc9 38
rgrover1 103:138bdc859cc9 39 /**@brief Connection Parameters Module event. */
rgrover1 103:138bdc859cc9 40 typedef struct
rgrover1 103:138bdc859cc9 41 {
rgrover1 103:138bdc859cc9 42 ble_conn_params_evt_type_t evt_type; /**< Type of event. */
rgrover1 103:138bdc859cc9 43 } ble_conn_params_evt_t;
rgrover1 103:138bdc859cc9 44
rgrover1 103:138bdc859cc9 45 /**@brief Connection Parameters Module event handler type. */
rgrover1 103:138bdc859cc9 46 typedef void (*ble_conn_params_evt_handler_t) (ble_conn_params_evt_t * p_evt);
rgrover1 103:138bdc859cc9 47
rgrover1 103:138bdc859cc9 48 /**@brief Connection Parameters Module init structure. This contains all options and data needed for
rgrover1 103:138bdc859cc9 49 * initialization of the connection parameters negotiation module. */
rgrover1 103:138bdc859cc9 50 typedef struct
rgrover1 103:138bdc859cc9 51 {
rgrover1 103:138bdc859cc9 52 ble_gap_conn_params_t * p_conn_params; /**< Pointer to the connection parameters desired by the application. When calling ble_conn_params_init, if this parameter is set to NULL, the connection parameters will be fetched from host. */
rgrover1 103:138bdc859cc9 53 uint32_t first_conn_params_update_delay; /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (in number of timer ticks). */
rgrover1 103:138bdc859cc9 54 uint32_t next_conn_params_update_delay; /**< Time between each call to sd_ble_gap_conn_param_update after the first (in number of timer ticks). Recommended value 30 seconds as per BLUETOOTH SPECIFICATION Version 4.0. */
rgrover1 103:138bdc859cc9 55 uint8_t max_conn_params_update_count; /**< Number of attempts before giving up the negotiation. */
rgrover1 103:138bdc859cc9 56 uint16_t start_on_notify_cccd_handle; /**< If procedure is to be started when notification is started, set this to the handle of the corresponding CCCD. Set to BLE_GATT_HANDLE_INVALID if procedure is to be started on connect event. */
rgrover1 103:138bdc859cc9 57 bool disconnect_on_fail; /**< Set to TRUE if a failed connection parameters update shall cause an automatic disconnection, set to FALSE otherwise. */
rgrover1 103:138bdc859cc9 58 ble_conn_params_evt_handler_t evt_handler; /**< Event handler to be called for handling events in the Connection Parameters. */
rgrover1 103:138bdc859cc9 59 ble_srv_error_handler_t error_handler; /**< Function to be called in case of an error. */
rgrover1 103:138bdc859cc9 60 } ble_conn_params_init_t;
rgrover1 103:138bdc859cc9 61
rgrover1 103:138bdc859cc9 62
rgrover1 103:138bdc859cc9 63 /**@brief Function for initializing the Connection Parameters module.
rgrover1 103:138bdc859cc9 64 *
rgrover1 106:7e1c66af835a 65 * @note If the negotiation procedure should be triggered when notification/indication of
rgrover1 103:138bdc859cc9 66 * any characteristic is enabled by the peer, then this function must be called after
rgrover1 103:138bdc859cc9 67 * having initialized the services.
rgrover1 103:138bdc859cc9 68 *
rgrover1 103:138bdc859cc9 69 * @param[in] p_init This contains information needed to initialize this module.
rgrover1 103:138bdc859cc9 70 *
rgrover1 103:138bdc859cc9 71 * @return NRF_SUCCESS on successful initialization, otherwise an error code.
rgrover1 103:138bdc859cc9 72 */
rgrover1 103:138bdc859cc9 73 uint32_t ble_conn_params_init(const ble_conn_params_init_t * p_init);
rgrover1 103:138bdc859cc9 74
rgrover1 103:138bdc859cc9 75 /**@brief Function for stopping the Connection Parameters module.
rgrover1 103:138bdc859cc9 76 *
rgrover1 103:138bdc859cc9 77 * @details This function is intended to be used by the application to clean up the connection
rgrover1 103:138bdc859cc9 78 * parameters update module. This will stop the connection parameters update timer if
rgrover1 103:138bdc859cc9 79 * running, thereby preventing any impending connection parameters update procedure. This
rgrover1 103:138bdc859cc9 80 * function must be called by the application when it needs to clean itself up (for
rgrover1 103:138bdc859cc9 81 * example, before disabling the bluetooth SoftDevice) so that an unwanted timer expiry
rgrover1 103:138bdc859cc9 82 * event can be avoided.
rgrover1 103:138bdc859cc9 83 *
rgrover1 103:138bdc859cc9 84 * @return NRF_SUCCESS on successful initialization, otherwise an error code.
rgrover1 103:138bdc859cc9 85 */
rgrover1 103:138bdc859cc9 86 uint32_t ble_conn_params_stop(void);
rgrover1 103:138bdc859cc9 87
rgrover1 103:138bdc859cc9 88 /**@brief Function for changing the current connection parameters to a new set.
rgrover1 103:138bdc859cc9 89 *
rgrover1 106:7e1c66af835a 90 * @details Use this function to change the connection parameters to a new set of parameter
rgrover1 103:138bdc859cc9 91 * (ie different from the ones given at init of the module).
rgrover1 103:138bdc859cc9 92 * This function is usefull for scenario where most of the time the application
rgrover1 103:138bdc859cc9 93 * needs a relatively big connection interval, and just sometimes, for a temporary
rgrover1 103:138bdc859cc9 94 * period requires shorter connection interval, for example to transfer a higher
rgrover1 103:138bdc859cc9 95 * amount of data.
rgrover1 103:138bdc859cc9 96 * If the given parameters does not match the current connection's parameters
rgrover1 103:138bdc859cc9 97 * this function initiates a new negotiation.
rgrover1 103:138bdc859cc9 98 *
rgrover1 103:138bdc859cc9 99 * @param[in] new_params This contains the new connections parameters to setup.
rgrover1 103:138bdc859cc9 100 *
rgrover1 103:138bdc859cc9 101 * @return NRF_SUCCESS on successful initialization, otherwise an error code.
rgrover1 103:138bdc859cc9 102 */
rgrover1 103:138bdc859cc9 103 uint32_t ble_conn_params_change_conn_params(ble_gap_conn_params_t *new_params);
rgrover1 103:138bdc859cc9 104
rgrover1 103:138bdc859cc9 105 /**@brief Function for handling the Application's BLE Stack events.
rgrover1 103:138bdc859cc9 106 *
rgrover1 103:138bdc859cc9 107 * @details Handles all events from the BLE stack that are of interest to this module.
rgrover1 103:138bdc859cc9 108 *
rgrover1 103:138bdc859cc9 109 * @param[in] p_ble_evt The event received from the BLE stack.
rgrover1 103:138bdc859cc9 110 */
rgrover1 103:138bdc859cc9 111 void ble_conn_params_on_ble_evt(ble_evt_t * p_ble_evt);
rgrover1 103:138bdc859cc9 112
rgrover1 104:55e59c802b7f 113 #ifdef __cplusplus
rgrover1 104:55e59c802b7f 114 }
rgrover1 104:55e59c802b7f 115 #endif
rgrover1 104:55e59c802b7f 116
rgrover1 103:138bdc859cc9 117 #endif // BLE_CONN_PARAMS_H__
rgrover1 103:138bdc859cc9 118
rgrover1 103:138bdc859cc9 119 /** @} */