/TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_KPSDK_CODE/hal/adc/fsl_adc_hal.h substitute line 894 extern } by }

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Fri Jul 25 09:46:51 2014 +0100
Revision:
87:6213f644d804
Release 87 of the mbed library

Main changes:

- error.h renamed to mbed_error.h to avoid name clashes
- upgraded to V7 of the nRF51822 soft-device 110
- New targets: HRM107
- Improved test infrastructure
- Bug fixes on various targets

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 87:6213f644d804 1 /*
bogdanm 87:6213f644d804 2 * Copyright (c) 2011 Nordic Semiconductor. All Rights Reserved.
bogdanm 87:6213f644d804 3 *
bogdanm 87:6213f644d804 4 * The information contained herein is confidential property of Nordic Semiconductor. The use,
bogdanm 87:6213f644d804 5 * copying, transfer or disclosure of such information is prohibited except by express written
bogdanm 87:6213f644d804 6 * agreement with Nordic Semiconductor.
bogdanm 87:6213f644d804 7 *
bogdanm 87:6213f644d804 8 */
bogdanm 87:6213f644d804 9 /**
bogdanm 87:6213f644d804 10 @defgroup nrf_sdm_api SoftDevice Manager API
bogdanm 87:6213f644d804 11 @{
bogdanm 87:6213f644d804 12
bogdanm 87:6213f644d804 13 @brief APIs for SoftDevice management.
bogdanm 87:6213f644d804 14
bogdanm 87:6213f644d804 15 */
bogdanm 87:6213f644d804 16
bogdanm 87:6213f644d804 17 /* Header guard */
bogdanm 87:6213f644d804 18 #ifndef NRF_SDM_H__
bogdanm 87:6213f644d804 19 #define NRF_SDM_H__
bogdanm 87:6213f644d804 20
bogdanm 87:6213f644d804 21 #include "nrf_svc.h"
bogdanm 87:6213f644d804 22 #include "nrf51.h"
bogdanm 87:6213f644d804 23 #include "nrf_soc.h"
bogdanm 87:6213f644d804 24 #include "nrf_error_sdm.h"
bogdanm 87:6213f644d804 25
bogdanm 87:6213f644d804 26 /** @addtogroup NRF_SDM_DEFINES Defines
bogdanm 87:6213f644d804 27 * @{ */
bogdanm 87:6213f644d804 28
bogdanm 87:6213f644d804 29 /**@brief SoftDevice Manager SVC Base number. */
bogdanm 87:6213f644d804 30 #define SDM_SVC_BASE (0x10)
bogdanm 87:6213f644d804 31
bogdanm 87:6213f644d804 32 /** @} */
bogdanm 87:6213f644d804 33
bogdanm 87:6213f644d804 34 /** @addtogroup NRF_SDM_ENUMS Enumerations
bogdanm 87:6213f644d804 35 * @{ */
bogdanm 87:6213f644d804 36
bogdanm 87:6213f644d804 37 /**@brief nRF SoftDevice Manager API SVC numbers. */
bogdanm 87:6213f644d804 38 enum NRF_SD_SVCS
bogdanm 87:6213f644d804 39 {
bogdanm 87:6213f644d804 40 SD_SOFTDEVICE_ENABLE = SDM_SVC_BASE, /**< ::sd_softdevice_enable */
bogdanm 87:6213f644d804 41 SD_SOFTDEVICE_DISABLE, /**< ::sd_softdevice_disable */
bogdanm 87:6213f644d804 42 SD_SOFTDEVICE_IS_ENABLED, /**< ::sd_softdevice_is_enabled */
bogdanm 87:6213f644d804 43 SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, /**< ::sd_softdevice_vector_table_base_set */
bogdanm 87:6213f644d804 44 SVC_SDM_LAST /**< Placeholder for last SDM SVC */
bogdanm 87:6213f644d804 45 };
bogdanm 87:6213f644d804 46
bogdanm 87:6213f644d804 47 /**@brief Possible lfclk oscillator sources. */
bogdanm 87:6213f644d804 48 enum NRF_CLOCK_LFCLKSRCS
bogdanm 87:6213f644d804 49 {
bogdanm 87:6213f644d804 50 NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, /**< LFCLK Synthesized from HFCLK. */
bogdanm 87:6213f644d804 51 NRF_CLOCK_LFCLKSRC_XTAL_500_PPM, /**< LFCLK crystal oscillator 500 PPM accuracy. */
bogdanm 87:6213f644d804 52 NRF_CLOCK_LFCLKSRC_XTAL_250_PPM, /**< LFCLK crystal oscillator 250 PPM accuracy. */
bogdanm 87:6213f644d804 53 NRF_CLOCK_LFCLKSRC_XTAL_150_PPM, /**< LFCLK crystal oscillator 150 PPM accuracy. */
bogdanm 87:6213f644d804 54 NRF_CLOCK_LFCLKSRC_XTAL_100_PPM, /**< LFCLK crystal oscillator 100 PPM accuracy. */
bogdanm 87:6213f644d804 55 NRF_CLOCK_LFCLKSRC_XTAL_75_PPM, /**< LFCLK crystal oscillator 75 PPM accuracy. */
bogdanm 87:6213f644d804 56 NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, /**< LFCLK crystal oscillator 50 PPM accuracy. */
bogdanm 87:6213f644d804 57 NRF_CLOCK_LFCLKSRC_XTAL_30_PPM, /**< LFCLK crystal oscillator 30 PPM accuracy. */
bogdanm 87:6213f644d804 58 NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, /**< LFCLK crystal oscillator 20 PPM accuracy. */
bogdanm 87:6213f644d804 59 NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, /**< LFCLK RC oscillator, 250ms calibration interval.*/
bogdanm 87:6213f644d804 60 NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION, /**< LFCLK RC oscillator, 500ms calibration interval.*/
bogdanm 87:6213f644d804 61 NRF_CLOCK_LFCLKSRC_RC_250_PPM_1000MS_CALIBRATION, /**< LFCLK RC oscillator, 1000ms calibration interval.*/
bogdanm 87:6213f644d804 62 NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION, /**< LFCLK RC oscillator, 2000ms calibration interval.*/
bogdanm 87:6213f644d804 63 NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, /**< LFCLK RC oscillator, 4000ms calibration interval.*/
bogdanm 87:6213f644d804 64 NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, /**< LFCLK RC oscillator, 8000ms calibration interval.*/
bogdanm 87:6213f644d804 65 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.*/
bogdanm 87:6213f644d804 66 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.*/
bogdanm 87:6213f644d804 67 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.*/
bogdanm 87:6213f644d804 68 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.*/
bogdanm 87:6213f644d804 69 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.*/
bogdanm 87:6213f644d804 70 };
bogdanm 87:6213f644d804 71
bogdanm 87:6213f644d804 72 /** @} */
bogdanm 87:6213f644d804 73
bogdanm 87:6213f644d804 74 /** @addtogroup NRF_SDM_TYPES Types
bogdanm 87:6213f644d804 75 * @{ */
bogdanm 87:6213f644d804 76
bogdanm 87:6213f644d804 77 /**@brief Type representing lfclk oscillator source. */
bogdanm 87:6213f644d804 78 typedef uint32_t nrf_clock_lfclksrc_t;
bogdanm 87:6213f644d804 79
bogdanm 87:6213f644d804 80
bogdanm 87:6213f644d804 81 /**@brief SoftDevice Assertion Handler type.
bogdanm 87:6213f644d804 82 *
bogdanm 87:6213f644d804 83 * When an unexpected error occurs within the SoftDevice it will call the SoftDevice assertion handler callback.
bogdanm 87:6213f644d804 84 * The protocol stack will be in an undefined state when this happens and the only way to recover will be to
bogdanm 87:6213f644d804 85 * perform a reset, using e.g. CMSIS NVIC_SystemReset().
bogdanm 87:6213f644d804 86 *
bogdanm 87:6213f644d804 87 * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the SoftDevice assert callback.
bogdanm 87:6213f644d804 88 *
bogdanm 87:6213f644d804 89 * @param[in] pc The program counter of the failed assert.
bogdanm 87:6213f644d804 90 * @param[in] line_number Line number where the assert failed.
bogdanm 87:6213f644d804 91 * @param[in] file_name File name where the assert failed.
bogdanm 87:6213f644d804 92 */
bogdanm 87:6213f644d804 93 typedef void (*softdevice_assertion_handler_t)(uint32_t pc, uint16_t line_number, const uint8_t * p_file_name);
bogdanm 87:6213f644d804 94
bogdanm 87:6213f644d804 95 /** @} */
bogdanm 87:6213f644d804 96
bogdanm 87:6213f644d804 97 /** @addtogroup NRF_SDM_FUNCTIONS Functions
bogdanm 87:6213f644d804 98 * @{ */
bogdanm 87:6213f644d804 99
bogdanm 87:6213f644d804 100 /**@brief Enables the SoftDevice and by extension the protocol stack.
bogdanm 87:6213f644d804 101 *
bogdanm 87:6213f644d804 102 * Idempotent function to enable the SoftDevice.
bogdanm 87:6213f644d804 103 *
bogdanm 87:6213f644d804 104 * @note Some care must be taken if a low frequency clock source is already running when calling this function:
bogdanm 87:6213f644d804 105 * If the LF clock has a different source then the one currently running, it will be stopped. Then, the new
bogdanm 87:6213f644d804 106 * clock source will be started.
bogdanm 87:6213f644d804 107 *
bogdanm 87:6213f644d804 108 * @note This function has no effect when returning with an error.
bogdanm 87:6213f644d804 109 *
bogdanm 87:6213f644d804 110 * @post If return code is ::NRF_SUCCESS
bogdanm 87:6213f644d804 111 * - SoC library and protocol stack APIs are made available
bogdanm 87:6213f644d804 112 * - A portion of RAM will be unavailable (see relevant SDS documentation)
bogdanm 87:6213f644d804 113 * - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation)
bogdanm 87:6213f644d804 114 * - Interrupts will not arrive from protected peripherals or interrupts
bogdanm 87:6213f644d804 115 * - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the softdevice.
bogdanm 87:6213f644d804 116 * - Interrupt latency may be affected by the SoftDevice (see relevant SDS documentation)
bogdanm 87:6213f644d804 117 * - Chosen low frequency clock source will be running
bogdanm 87:6213f644d804 118 *
bogdanm 87:6213f644d804 119 * @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).
bogdanm 87:6213f644d804 120 * @param assertion_handler Callback for SoftDevice assertions.
bogdanm 87:6213f644d804 121 *
bogdanm 87:6213f644d804 122 * @retval ::NRF_SUCCESS
bogdanm 87:6213f644d804 123 * @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDeviceinterrupt is already enabled, or an enabled interrupt has an illegal priority level
bogdanm 87:6213f644d804 124 * @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected
bogdanm 87:6213f644d804 125 */
bogdanm 87:6213f644d804 126 SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lfclksrc_t clock_source, softdevice_assertion_handler_t assertion_handler));
bogdanm 87:6213f644d804 127
bogdanm 87:6213f644d804 128 /**@brief Disables the SoftDevice and by extension the protocol stack.
bogdanm 87:6213f644d804 129 *
bogdanm 87:6213f644d804 130 * Idempotent function to disable the SoftDevice.
bogdanm 87:6213f644d804 131 *
bogdanm 87:6213f644d804 132 * @post SoC library and protocol stack APIs are made unavailable.
bogdanm 87:6213f644d804 133 * @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest).
bogdanm 87:6213f644d804 134 * @post All peripherals used by the SoftDevice will be reset to default values.
bogdanm 87:6213f644d804 135 * @post All of RAM become available.
bogdanm 87:6213f644d804 136 * @post All interrupts are forwarded to the application.
bogdanm 87:6213f644d804 137 * @post LFCLK source chosen in ::sd_softdevice_enable will be left running.
bogdanm 87:6213f644d804 138 *
bogdanm 87:6213f644d804 139 * @retval ::NRF_SUCCESS
bogdanm 87:6213f644d804 140 */
bogdanm 87:6213f644d804 141 SVCALL(SD_SOFTDEVICE_DISABLE, uint32_t, sd_softdevice_disable(void));
bogdanm 87:6213f644d804 142
bogdanm 87:6213f644d804 143 /**@brief Check if the SoftDevice is enabled.
bogdanm 87:6213f644d804 144 *
bogdanm 87:6213f644d804 145 * @param[out] p_softdevice_enabled If the SoftDevice is enabled: 1 else 0.
bogdanm 87:6213f644d804 146 *
bogdanm 87:6213f644d804 147 * @retval ::NRF_SUCCESS
bogdanm 87:6213f644d804 148 */
bogdanm 87:6213f644d804 149 SVCALL(SD_SOFTDEVICE_IS_ENABLED, uint32_t, sd_softdevice_is_enabled(uint8_t * p_softdevice_enabled));
bogdanm 87:6213f644d804 150
bogdanm 87:6213f644d804 151 /**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice
bogdanm 87:6213f644d804 152 *
bogdanm 87:6213f644d804 153 * This function is only intended to be called when a bootloader is enabled.
bogdanm 87:6213f644d804 154 *
bogdanm 87:6213f644d804 155 * @param[in] address The base address of the interrupt vector table for forwarded interrupts.
bogdanm 87:6213f644d804 156
bogdanm 87:6213f644d804 157 * @retval ::NRF_SUCCESS
bogdanm 87:6213f644d804 158 */
bogdanm 87:6213f644d804 159 SVCALL(SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, uint32_t, sd_softdevice_vector_table_base_set(uint32_t address));
bogdanm 87:6213f644d804 160
bogdanm 87:6213f644d804 161 /** @} */
bogdanm 87:6213f644d804 162
bogdanm 87:6213f644d804 163 #endif // NRF_SDM_H__
bogdanm 87:6213f644d804 164
bogdanm 87:6213f644d804 165 /**
bogdanm 87:6213f644d804 166 @}
bogdanm 87:6213f644d804 167 */