Nordic stack and drivers for the mbed BLE API
Fork of nRF51822 by
TARGET_MCU_NRF51822/sdk/source/softdevice/s130/headers/nrf_sdm.h@640:c90ae1400bf2, 2016-09-14 (annotated)
- Committer:
- Vincent Coubard
- Date:
- Wed Sep 14 14:39:43 2016 +0100
- Revision:
- 640:c90ae1400bf2
Sync with bdab10dc0f90748b6989c8b577771bb403ca6bd8 from ARMmbed/mbed-os.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vincent Coubard |
640:c90ae1400bf2 | 1 | /* |
Vincent Coubard |
640:c90ae1400bf2 | 2 | * Copyright (c) Nordic Semiconductor ASA |
Vincent Coubard |
640:c90ae1400bf2 | 3 | * All rights reserved. |
Vincent Coubard |
640:c90ae1400bf2 | 4 | * |
Vincent Coubard |
640:c90ae1400bf2 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Vincent Coubard |
640:c90ae1400bf2 | 6 | * are permitted provided that the following conditions are met: |
Vincent Coubard |
640:c90ae1400bf2 | 7 | * |
Vincent Coubard |
640:c90ae1400bf2 | 8 | * 1. Redistributions of source code must retain the above copyright notice, this |
Vincent Coubard |
640:c90ae1400bf2 | 9 | * list of conditions and the following disclaimer. |
Vincent Coubard |
640:c90ae1400bf2 | 10 | * |
Vincent Coubard |
640:c90ae1400bf2 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this |
Vincent Coubard |
640:c90ae1400bf2 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
Vincent Coubard |
640:c90ae1400bf2 | 13 | * other materials provided with the distribution. |
Vincent Coubard |
640:c90ae1400bf2 | 14 | * |
Vincent Coubard |
640:c90ae1400bf2 | 15 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of other |
Vincent Coubard |
640:c90ae1400bf2 | 16 | * contributors to this software may be used to endorse or promote products |
Vincent Coubard |
640:c90ae1400bf2 | 17 | * derived from this software without specific prior written permission. |
Vincent Coubard |
640:c90ae1400bf2 | 18 | * |
Vincent Coubard |
640:c90ae1400bf2 | 19 | * |
Vincent Coubard |
640:c90ae1400bf2 | 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Vincent Coubard |
640:c90ae1400bf2 | 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Vincent Coubard |
640:c90ae1400bf2 | 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Vincent Coubard |
640:c90ae1400bf2 | 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Vincent Coubard |
640:c90ae1400bf2 | 24 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Vincent Coubard |
640:c90ae1400bf2 | 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Vincent Coubard |
640:c90ae1400bf2 | 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Vincent Coubard |
640:c90ae1400bf2 | 27 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Vincent Coubard |
640:c90ae1400bf2 | 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Vincent Coubard |
640:c90ae1400bf2 | 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Vincent Coubard |
640:c90ae1400bf2 | 30 | * |
Vincent Coubard |
640:c90ae1400bf2 | 31 | */ |
Vincent Coubard |
640:c90ae1400bf2 | 32 | /** |
Vincent Coubard |
640:c90ae1400bf2 | 33 | @defgroup nrf_sdm_api SoftDevice Manager API |
Vincent Coubard |
640:c90ae1400bf2 | 34 | @{ |
Vincent Coubard |
640:c90ae1400bf2 | 35 | |
Vincent Coubard |
640:c90ae1400bf2 | 36 | @brief APIs for SoftDevice management. |
Vincent Coubard |
640:c90ae1400bf2 | 37 | |
Vincent Coubard |
640:c90ae1400bf2 | 38 | */ |
Vincent Coubard |
640:c90ae1400bf2 | 39 | |
Vincent Coubard |
640:c90ae1400bf2 | 40 | /* Header guard */ |
Vincent Coubard |
640:c90ae1400bf2 | 41 | #ifndef NRF_SDM_H__ |
Vincent Coubard |
640:c90ae1400bf2 | 42 | #define NRF_SDM_H__ |
Vincent Coubard |
640:c90ae1400bf2 | 43 | |
Vincent Coubard |
640:c90ae1400bf2 | 44 | #include "nrf_svc.h" |
Vincent Coubard |
640:c90ae1400bf2 | 45 | #include "nrf.h" |
Vincent Coubard |
640:c90ae1400bf2 | 46 | #include "nrf_soc.h" |
Vincent Coubard |
640:c90ae1400bf2 | 47 | #include "nrf_error_sdm.h" |
Vincent Coubard |
640:c90ae1400bf2 | 48 | |
Vincent Coubard |
640:c90ae1400bf2 | 49 | /** @addtogroup NRF_SDM_DEFINES Defines |
Vincent Coubard |
640:c90ae1400bf2 | 50 | * @{ */ |
Vincent Coubard |
640:c90ae1400bf2 | 51 | |
Vincent Coubard |
640:c90ae1400bf2 | 52 | /** @brief SoftDevice Manager SVC Base number. */ |
Vincent Coubard |
640:c90ae1400bf2 | 53 | #define SDM_SVC_BASE 0x10 |
Vincent Coubard |
640:c90ae1400bf2 | 54 | |
Vincent Coubard |
640:c90ae1400bf2 | 55 | /** @} */ |
Vincent Coubard |
640:c90ae1400bf2 | 56 | |
Vincent Coubard |
640:c90ae1400bf2 | 57 | /** @brief Defines the SoftDevice Information Structure location (address) as an offset from |
Vincent Coubard |
640:c90ae1400bf2 | 58 | the start of the softdevice (without MBR)*/ |
Vincent Coubard |
640:c90ae1400bf2 | 59 | #define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000) |
Vincent Coubard |
640:c90ae1400bf2 | 60 | |
Vincent Coubard |
640:c90ae1400bf2 | 61 | /** @brief Defines the usual size reserverd for the MBR when a softdevice is written to flash. |
Vincent Coubard |
640:c90ae1400bf2 | 62 | This is the offset where the first byte of the softdevice hex file is written.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 63 | #define MBR_SIZE (0x1000) |
Vincent Coubard |
640:c90ae1400bf2 | 64 | |
Vincent Coubard |
640:c90ae1400bf2 | 65 | /** @brief Defines the absolute Softdevice information structure location (address)*/ |
Vincent Coubard |
640:c90ae1400bf2 | 66 | #define SOFTDEVICE_INFO_STRUCT_ADDRESS (SOFTDEVICE_INFO_STRUCT_OFFSET + MBR_SIZE) |
Vincent Coubard |
640:c90ae1400bf2 | 67 | |
Vincent Coubard |
640:c90ae1400bf2 | 68 | /** @brief Defines the offset for Softdevice size value relative to Softdevice base address*/ |
Vincent Coubard |
640:c90ae1400bf2 | 69 | #define SD_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x08) |
Vincent Coubard |
640:c90ae1400bf2 | 70 | |
Vincent Coubard |
640:c90ae1400bf2 | 71 | /** @brief Defines the offset for FWID value relative to Softdevice base address*/ |
Vincent Coubard |
640:c90ae1400bf2 | 72 | #define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C) |
Vincent Coubard |
640:c90ae1400bf2 | 73 | |
Vincent Coubard |
640:c90ae1400bf2 | 74 | /** @brief Defines a macro for retreiving the actual Softdevice size value from a given base address |
Vincent Coubard |
640:c90ae1400bf2 | 75 | use @ref MBR_SIZE when Softdevice is installed just above the MBR (the usual case)*/ |
Vincent Coubard |
640:c90ae1400bf2 | 76 | #define SD_SIZE_GET(baseaddr) (*((uint32_t *) ((baseaddr) + SD_SIZE_OFFSET))) |
Vincent Coubard |
640:c90ae1400bf2 | 77 | |
Vincent Coubard |
640:c90ae1400bf2 | 78 | /** @brief Defines a macro for retreiving the actual FWID value from a given base address |
Vincent Coubard |
640:c90ae1400bf2 | 79 | use @ref MBR_SIZE when Softdevice is installed just above the MBR (the usual case)*/ |
Vincent Coubard |
640:c90ae1400bf2 | 80 | #define SD_FWID_GET(baseaddr) ((*((uint32_t *) ((baseaddr) + SD_FWID_OFFSET))) & 0xFFFF) |
Vincent Coubard |
640:c90ae1400bf2 | 81 | |
Vincent Coubard |
640:c90ae1400bf2 | 82 | |
Vincent Coubard |
640:c90ae1400bf2 | 83 | /** @addtogroup NRF_SDM_ENUMS Enumerations |
Vincent Coubard |
640:c90ae1400bf2 | 84 | * @{ */ |
Vincent Coubard |
640:c90ae1400bf2 | 85 | |
Vincent Coubard |
640:c90ae1400bf2 | 86 | /**@brief nRF SoftDevice Manager API SVC numbers. */ |
Vincent Coubard |
640:c90ae1400bf2 | 87 | enum NRF_SD_SVCS |
Vincent Coubard |
640:c90ae1400bf2 | 88 | { |
Vincent Coubard |
640:c90ae1400bf2 | 89 | SD_SOFTDEVICE_ENABLE = SDM_SVC_BASE, /**< ::sd_softdevice_enable */ |
Vincent Coubard |
640:c90ae1400bf2 | 90 | SD_SOFTDEVICE_DISABLE, /**< ::sd_softdevice_disable */ |
Vincent Coubard |
640:c90ae1400bf2 | 91 | SD_SOFTDEVICE_IS_ENABLED, /**< ::sd_softdevice_is_enabled */ |
Vincent Coubard |
640:c90ae1400bf2 | 92 | SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, /**< ::sd_softdevice_vector_table_base_set */ |
Vincent Coubard |
640:c90ae1400bf2 | 93 | SVC_SDM_LAST /**< Placeholder for last SDM SVC */ |
Vincent Coubard |
640:c90ae1400bf2 | 94 | }; |
Vincent Coubard |
640:c90ae1400bf2 | 95 | |
Vincent Coubard |
640:c90ae1400bf2 | 96 | /**@brief Possible lfclk oscillator sources. */ |
Vincent Coubard |
640:c90ae1400bf2 | 97 | enum NRF_CLOCK_LFCLKSRCS |
Vincent Coubard |
640:c90ae1400bf2 | 98 | { |
Vincent Coubard |
640:c90ae1400bf2 | 99 | NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, /**< LFCLK Synthesized from HFCLK. */ |
Vincent Coubard |
640:c90ae1400bf2 | 100 | NRF_CLOCK_LFCLKSRC_XTAL_500_PPM, /**< LFCLK crystal oscillator 500 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 101 | NRF_CLOCK_LFCLKSRC_XTAL_250_PPM, /**< LFCLK crystal oscillator 250 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 102 | NRF_CLOCK_LFCLKSRC_XTAL_150_PPM, /**< LFCLK crystal oscillator 150 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 103 | NRF_CLOCK_LFCLKSRC_XTAL_100_PPM, /**< LFCLK crystal oscillator 100 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 104 | NRF_CLOCK_LFCLKSRC_XTAL_75_PPM, /**< LFCLK crystal oscillator 75 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 105 | NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, /**< LFCLK crystal oscillator 50 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 106 | NRF_CLOCK_LFCLKSRC_XTAL_30_PPM, /**< LFCLK crystal oscillator 30 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 107 | NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, /**< LFCLK crystal oscillator 20 PPM accuracy. */ |
Vincent Coubard |
640:c90ae1400bf2 | 108 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, /**< LFCLK RC oscillator, 250ms calibration interval.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 109 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION, /**< LFCLK RC oscillator, 500ms calibration interval.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 110 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_1000MS_CALIBRATION, /**< LFCLK RC oscillator, 1000ms calibration interval.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 111 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION, /**< LFCLK RC oscillator, 2000ms calibration interval.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 112 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, /**< LFCLK RC oscillator, 4000ms calibration interval.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 113 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, /**< LFCLK RC oscillator, 8000ms calibration interval.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 114 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_1000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 1000ms, if changed above a threshold, a calibration is done.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 115 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_2000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 2000ms, if changed above a threshold, a calibration is done.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 116 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 4000ms, if changed above a threshold, a calibration is done.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 117 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_8000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 8000ms, if changed above a threshold, a calibration is done.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 118 | NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_16000MS_CALIBRATION, /**< LFCLK RC oscillator. Temperature checked every 16000ms, if changed above a threshold, a calibration is done.*/ |
Vincent Coubard |
640:c90ae1400bf2 | 119 | }; |
Vincent Coubard |
640:c90ae1400bf2 | 120 | |
Vincent Coubard |
640:c90ae1400bf2 | 121 | /** @} */ |
Vincent Coubard |
640:c90ae1400bf2 | 122 | |
Vincent Coubard |
640:c90ae1400bf2 | 123 | /** @addtogroup NRF_SDM_TYPES Types |
Vincent Coubard |
640:c90ae1400bf2 | 124 | * @{ */ |
Vincent Coubard |
640:c90ae1400bf2 | 125 | |
Vincent Coubard |
640:c90ae1400bf2 | 126 | /**@brief Type representing lfclk oscillator source. */ |
Vincent Coubard |
640:c90ae1400bf2 | 127 | typedef uint32_t nrf_clock_lfclksrc_t; |
Vincent Coubard |
640:c90ae1400bf2 | 128 | |
Vincent Coubard |
640:c90ae1400bf2 | 129 | |
Vincent Coubard |
640:c90ae1400bf2 | 130 | /**@brief SoftDevice Assertion Handler type. |
Vincent Coubard |
640:c90ae1400bf2 | 131 | * |
Vincent Coubard |
640:c90ae1400bf2 | 132 | * When an unexpected error occurs within the SoftDevice it will call the SoftDevice assertion handler callback. |
Vincent Coubard |
640:c90ae1400bf2 | 133 | * The protocol stack will be in an undefined state when this happens and the only way to recover will be to |
Vincent Coubard |
640:c90ae1400bf2 | 134 | * perform a reset, using e.g. CMSIS NVIC_SystemReset(). |
Vincent Coubard |
640:c90ae1400bf2 | 135 | * |
Vincent Coubard |
640:c90ae1400bf2 | 136 | * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the SoftDevice assert callback. |
Vincent Coubard |
640:c90ae1400bf2 | 137 | * |
Vincent Coubard |
640:c90ae1400bf2 | 138 | * @param[in] pc The program counter of the failed assert. |
Vincent Coubard |
640:c90ae1400bf2 | 139 | * @param[in] line_number Line number where the assert failed. |
Vincent Coubard |
640:c90ae1400bf2 | 140 | * @param[in] file_name File name where the assert failed. |
Vincent Coubard |
640:c90ae1400bf2 | 141 | */ |
Vincent Coubard |
640:c90ae1400bf2 | 142 | typedef void (*softdevice_assertion_handler_t)(uint32_t pc, uint16_t line_number, const uint8_t * p_file_name); |
Vincent Coubard |
640:c90ae1400bf2 | 143 | |
Vincent Coubard |
640:c90ae1400bf2 | 144 | /** @} */ |
Vincent Coubard |
640:c90ae1400bf2 | 145 | |
Vincent Coubard |
640:c90ae1400bf2 | 146 | /** @addtogroup NRF_SDM_FUNCTIONS Functions |
Vincent Coubard |
640:c90ae1400bf2 | 147 | * @{ */ |
Vincent Coubard |
640:c90ae1400bf2 | 148 | |
Vincent Coubard |
640:c90ae1400bf2 | 149 | /**@brief Enables the SoftDevice and by extension the protocol stack. |
Vincent Coubard |
640:c90ae1400bf2 | 150 | * |
Vincent Coubard |
640:c90ae1400bf2 | 151 | * Idempotent function to enable the SoftDevice. |
Vincent Coubard |
640:c90ae1400bf2 | 152 | * |
Vincent Coubard |
640:c90ae1400bf2 | 153 | * @note Some care must be taken if a low frequency clock source is already running when calling this function: |
Vincent Coubard |
640:c90ae1400bf2 | 154 | * If the LF clock has a different source then the one currently running, it will be stopped. Then, the new |
Vincent Coubard |
640:c90ae1400bf2 | 155 | * clock source will be started. |
Vincent Coubard |
640:c90ae1400bf2 | 156 | * |
Vincent Coubard |
640:c90ae1400bf2 | 157 | * @note This function has no effect when returning with an error. |
Vincent Coubard |
640:c90ae1400bf2 | 158 | * |
Vincent Coubard |
640:c90ae1400bf2 | 159 | * @post If return code is ::NRF_SUCCESS |
Vincent Coubard |
640:c90ae1400bf2 | 160 | * - SoC library and protocol stack APIs are made available. |
Vincent Coubard |
640:c90ae1400bf2 | 161 | * - A portion of RAM will be unavailable (see relevant SDS documentation). |
Vincent Coubard |
640:c90ae1400bf2 | 162 | * - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation). |
Vincent Coubard |
640:c90ae1400bf2 | 163 | * - Interrupts will not arrive from protected peripherals or interrupts. |
Vincent Coubard |
640:c90ae1400bf2 | 164 | * - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the softdevice. |
Vincent Coubard |
640:c90ae1400bf2 | 165 | * - Interrupt latency may be affected by the SoftDevice (see relevant SDS documentation). |
Vincent Coubard |
640:c90ae1400bf2 | 166 | * - Chosen low frequency clock source will be running. |
Vincent Coubard |
640:c90ae1400bf2 | 167 | * |
Vincent Coubard |
640:c90ae1400bf2 | 168 | * @param clock_source Low frequency clock source and accuracy. (Note: In the case of XTAL source, the PPM accuracy of the chosen clock source must be greater than or equal to the actual characteristics of your XTAL clock). |
Vincent Coubard |
640:c90ae1400bf2 | 169 | * @param assertion_handler Callback for SoftDevice assertions. |
Vincent Coubard |
640:c90ae1400bf2 | 170 | * |
Vincent Coubard |
640:c90ae1400bf2 | 171 | * @retval ::NRF_SUCCESS |
Vincent Coubard |
640:c90ae1400bf2 | 172 | * @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and assertion handler cannot be updated. |
Vincent Coubard |
640:c90ae1400bf2 | 173 | * @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDeviceinterrupt is already enabled, or an enabled interrupt has an illegal priority level. |
Vincent Coubard |
640:c90ae1400bf2 | 174 | * @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected. |
Vincent Coubard |
640:c90ae1400bf2 | 175 | */ |
Vincent Coubard |
640:c90ae1400bf2 | 176 | SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lfclksrc_t clock_source, softdevice_assertion_handler_t assertion_handler)); |
Vincent Coubard |
640:c90ae1400bf2 | 177 | |
Vincent Coubard |
640:c90ae1400bf2 | 178 | /**@brief Disables the SoftDevice and by extension the protocol stack. |
Vincent Coubard |
640:c90ae1400bf2 | 179 | * |
Vincent Coubard |
640:c90ae1400bf2 | 180 | * Idempotent function to disable the SoftDevice. |
Vincent Coubard |
640:c90ae1400bf2 | 181 | * |
Vincent Coubard |
640:c90ae1400bf2 | 182 | * @post SoC library and protocol stack APIs are made unavailable. |
Vincent Coubard |
640:c90ae1400bf2 | 183 | * @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest). |
Vincent Coubard |
640:c90ae1400bf2 | 184 | * @post All peripherals used by the SoftDevice will be reset to default values. |
Vincent Coubard |
640:c90ae1400bf2 | 185 | * @post All of RAM become available. |
Vincent Coubard |
640:c90ae1400bf2 | 186 | * @post All interrupts are forwarded to the application. |
Vincent Coubard |
640:c90ae1400bf2 | 187 | * @post LFCLK source chosen in ::sd_softdevice_enable will be left running. |
Vincent Coubard |
640:c90ae1400bf2 | 188 | * |
Vincent Coubard |
640:c90ae1400bf2 | 189 | * @retval ::NRF_SUCCESS |
Vincent Coubard |
640:c90ae1400bf2 | 190 | */ |
Vincent Coubard |
640:c90ae1400bf2 | 191 | SVCALL(SD_SOFTDEVICE_DISABLE, uint32_t, sd_softdevice_disable(void)); |
Vincent Coubard |
640:c90ae1400bf2 | 192 | |
Vincent Coubard |
640:c90ae1400bf2 | 193 | /**@brief Check if the SoftDevice is enabled. |
Vincent Coubard |
640:c90ae1400bf2 | 194 | * |
Vincent Coubard |
640:c90ae1400bf2 | 195 | * @param[out] p_softdevice_enabled If the SoftDevice is enabled: 1 else 0. |
Vincent Coubard |
640:c90ae1400bf2 | 196 | * |
Vincent Coubard |
640:c90ae1400bf2 | 197 | * @retval ::NRF_SUCCESS |
Vincent Coubard |
640:c90ae1400bf2 | 198 | */ |
Vincent Coubard |
640:c90ae1400bf2 | 199 | SVCALL(SD_SOFTDEVICE_IS_ENABLED, uint32_t, sd_softdevice_is_enabled(uint8_t * p_softdevice_enabled)); |
Vincent Coubard |
640:c90ae1400bf2 | 200 | |
Vincent Coubard |
640:c90ae1400bf2 | 201 | /**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice |
Vincent Coubard |
640:c90ae1400bf2 | 202 | * |
Vincent Coubard |
640:c90ae1400bf2 | 203 | * This function is only intended to be called when a bootloader is enabled. |
Vincent Coubard |
640:c90ae1400bf2 | 204 | * |
Vincent Coubard |
640:c90ae1400bf2 | 205 | * @param[in] address The base address of the interrupt vector table for forwarded interrupts. |
Vincent Coubard |
640:c90ae1400bf2 | 206 | |
Vincent Coubard |
640:c90ae1400bf2 | 207 | * @retval ::NRF_SUCCESS |
Vincent Coubard |
640:c90ae1400bf2 | 208 | */ |
Vincent Coubard |
640:c90ae1400bf2 | 209 | SVCALL(SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, uint32_t, sd_softdevice_vector_table_base_set(uint32_t address)); |
Vincent Coubard |
640:c90ae1400bf2 | 210 | |
Vincent Coubard |
640:c90ae1400bf2 | 211 | /** @} */ |
Vincent Coubard |
640:c90ae1400bf2 | 212 | |
Vincent Coubard |
640:c90ae1400bf2 | 213 | #endif // NRF_SDM_H__ |
Vincent Coubard |
640:c90ae1400bf2 | 214 | |
Vincent Coubard |
640:c90ae1400bf2 | 215 | /** |
Vincent Coubard |
640:c90ae1400bf2 | 216 | @} |
Vincent Coubard |
640:c90ae1400bf2 | 217 | */ |