mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_API/include/nrf_soc.h@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 277:0dffe5d9e928
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 277:0dffe5d9e928 | 1 | /* Copyright (c) 2011 Nordic Semiconductor. All Rights Reserved. |
mbed_official | 277:0dffe5d9e928 | 2 | * |
mbed_official | 277:0dffe5d9e928 | 3 | * The information contained herein is confidential property of Nordic Semiconductor. The use, |
mbed_official | 277:0dffe5d9e928 | 4 | * copying, transfer or disclosure of such information is prohibited except by express written |
mbed_official | 277:0dffe5d9e928 | 5 | * agreement with Nordic Semiconductor. |
mbed_official | 277:0dffe5d9e928 | 6 | * |
mbed_official | 277:0dffe5d9e928 | 7 | */ |
mbed_official | 277:0dffe5d9e928 | 8 | |
mbed_official | 277:0dffe5d9e928 | 9 | /** |
mbed_official | 277:0dffe5d9e928 | 10 | * @defgroup nrf_soc_api SoC Library API |
mbed_official | 277:0dffe5d9e928 | 11 | * @{ |
mbed_official | 277:0dffe5d9e928 | 12 | * |
mbed_official | 277:0dffe5d9e928 | 13 | * @brief APIs for the SoC library. |
mbed_official | 277:0dffe5d9e928 | 14 | * |
mbed_official | 277:0dffe5d9e928 | 15 | */ |
mbed_official | 277:0dffe5d9e928 | 16 | |
mbed_official | 277:0dffe5d9e928 | 17 | #ifndef NRF_SOC_H__ |
mbed_official | 277:0dffe5d9e928 | 18 | #define NRF_SOC_H__ |
mbed_official | 277:0dffe5d9e928 | 19 | |
mbed_official | 277:0dffe5d9e928 | 20 | #include <stdint.h> |
mbed_official | 277:0dffe5d9e928 | 21 | #include <stdbool.h> |
mbed_official | 277:0dffe5d9e928 | 22 | #include "nrf_svc.h" |
mbed_official | 277:0dffe5d9e928 | 23 | #include "nrf51.h" |
mbed_official | 277:0dffe5d9e928 | 24 | #include "nrf51_bitfields.h" |
mbed_official | 277:0dffe5d9e928 | 25 | #include "nrf_error_soc.h" |
mbed_official | 277:0dffe5d9e928 | 26 | |
mbed_official | 277:0dffe5d9e928 | 27 | /** @addtogroup NRF_SOC_DEFINES Defines |
mbed_official | 277:0dffe5d9e928 | 28 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 29 | |
mbed_official | 277:0dffe5d9e928 | 30 | /**@brief The number of the lowest SVC number reserved for the SoC library. */ |
mbed_official | 277:0dffe5d9e928 | 31 | #define SOC_SVC_BASE (0x20) |
mbed_official | 277:0dffe5d9e928 | 32 | #define SOC_SVC_BASE_NOT_AVAILABLE (0x23) |
mbed_official | 277:0dffe5d9e928 | 33 | |
mbed_official | 277:0dffe5d9e928 | 34 | /**@brief Guranteed time for application to process radio inactive notification. */ |
mbed_official | 277:0dffe5d9e928 | 35 | #define NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US (62) |
mbed_official | 277:0dffe5d9e928 | 36 | |
mbed_official | 277:0dffe5d9e928 | 37 | /**@brief The minimum allowed timeslot extension time. */ |
mbed_official | 277:0dffe5d9e928 | 38 | #define NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US (200) |
mbed_official | 277:0dffe5d9e928 | 39 | |
mbed_official | 277:0dffe5d9e928 | 40 | #define SOC_ECB_KEY_LENGTH (16) /**< ECB key length. */ |
mbed_official | 277:0dffe5d9e928 | 41 | #define SOC_ECB_CLEARTEXT_LENGTH (16) /**< ECB cleartext length. */ |
mbed_official | 277:0dffe5d9e928 | 42 | #define SOC_ECB_CIPHERTEXT_LENGTH (SOC_ECB_CLEARTEXT_LENGTH) /**< ECB ciphertext length. */ |
mbed_official | 277:0dffe5d9e928 | 43 | |
mbed_official | 277:0dffe5d9e928 | 44 | #define SD_EVT_IRQn (SWI2_IRQn) /**< SoftDevice Event IRQ number. Used for both protocol events and SoC events. */ |
mbed_official | 277:0dffe5d9e928 | 45 | #define SD_EVT_IRQHandler (SWI2_IRQHandler) /**< SoftDevice Event IRQ handler. Used for both protocol events and SoC events. */ |
mbed_official | 277:0dffe5d9e928 | 46 | #define RADIO_NOTIFICATION_IRQn (SWI1_IRQn) /**< The radio notification IRQ number. */ |
mbed_official | 277:0dffe5d9e928 | 47 | #define RADIO_NOTIFICATION_IRQHandler (SWI1_IRQHandler) /**< The radio notification IRQ handler. */ |
mbed_official | 277:0dffe5d9e928 | 48 | |
mbed_official | 277:0dffe5d9e928 | 49 | #define NRF_RADIO_LENGTH_MIN_US (100) /**< The shortest allowed radio timeslot, in microseconds. */ |
mbed_official | 277:0dffe5d9e928 | 50 | #define NRF_RADIO_LENGTH_MAX_US (100000) /**< The longest allowed radio timeslot, in microseconds. */ |
mbed_official | 277:0dffe5d9e928 | 51 | |
mbed_official | 277:0dffe5d9e928 | 52 | #define NRF_RADIO_DISTANCE_MAX_US (128000000UL - 1UL) /**< The longest timeslot distance, in microseconds, allowed for the distance parameter (see @ref nrf_radio_request_normal_t) in the request. */ |
mbed_official | 277:0dffe5d9e928 | 53 | |
mbed_official | 277:0dffe5d9e928 | 54 | #define NRF_RADIO_EARLIEST_TIMEOUT_MAX_US (128000000UL - 1UL) /**< The longest timeout, in microseconds, allowed when requesting the earliest possible timeslot. */ |
mbed_official | 277:0dffe5d9e928 | 55 | |
mbed_official | 277:0dffe5d9e928 | 56 | #define NRF_RADIO_START_JITTER_US (2) /**< The maximum jitter in NRF_RADIO_CALLBACK_SIGNAL_TYPE_START relative to the requested start time. */ |
mbed_official | 277:0dffe5d9e928 | 57 | |
mbed_official | 277:0dffe5d9e928 | 58 | /** @} */ |
mbed_official | 277:0dffe5d9e928 | 59 | |
mbed_official | 277:0dffe5d9e928 | 60 | /** @addtogroup NRF_SOC_TYPES Types |
mbed_official | 277:0dffe5d9e928 | 61 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 62 | |
mbed_official | 277:0dffe5d9e928 | 63 | /**@brief The SVC numbers used by the SVC functions in the SoC library. */ |
mbed_official | 277:0dffe5d9e928 | 64 | enum NRF_SOC_SVCS |
mbed_official | 277:0dffe5d9e928 | 65 | { |
mbed_official | 277:0dffe5d9e928 | 66 | SD_FLASH_PAGE_ERASE = SOC_SVC_BASE, |
mbed_official | 277:0dffe5d9e928 | 67 | SD_FLASH_WRITE, |
mbed_official | 277:0dffe5d9e928 | 68 | SD_FLASH_PROTECT, |
mbed_official | 277:0dffe5d9e928 | 69 | SD_MUTEX_NEW = SOC_SVC_BASE_NOT_AVAILABLE, |
mbed_official | 277:0dffe5d9e928 | 70 | SD_MUTEX_ACQUIRE, |
mbed_official | 277:0dffe5d9e928 | 71 | SD_MUTEX_RELEASE, |
mbed_official | 277:0dffe5d9e928 | 72 | SD_NVIC_ENABLEIRQ, |
mbed_official | 277:0dffe5d9e928 | 73 | SD_NVIC_DISABLEIRQ, |
mbed_official | 277:0dffe5d9e928 | 74 | SD_NVIC_GETPENDINGIRQ, |
mbed_official | 277:0dffe5d9e928 | 75 | SD_NVIC_SETPENDINGIRQ, |
mbed_official | 277:0dffe5d9e928 | 76 | SD_NVIC_CLEARPENDINGIRQ, |
mbed_official | 277:0dffe5d9e928 | 77 | SD_NVIC_SETPRIORITY, |
mbed_official | 277:0dffe5d9e928 | 78 | SD_NVIC_GETPRIORITY, |
mbed_official | 277:0dffe5d9e928 | 79 | SD_NVIC_SYSTEMRESET, |
mbed_official | 277:0dffe5d9e928 | 80 | SD_NVIC_CRITICAL_REGION_ENTER, |
mbed_official | 277:0dffe5d9e928 | 81 | SD_NVIC_CRITICAL_REGION_EXIT, |
mbed_official | 277:0dffe5d9e928 | 82 | SD_RAND_APPLICATION_POOL_CAPACITY, |
mbed_official | 277:0dffe5d9e928 | 83 | SD_RAND_APPLICATION_BYTES_AVAILABLE, |
mbed_official | 277:0dffe5d9e928 | 84 | SD_RAND_APPLICATION_GET_VECTOR, |
mbed_official | 277:0dffe5d9e928 | 85 | SD_POWER_MODE_SET, |
mbed_official | 277:0dffe5d9e928 | 86 | SD_POWER_SYSTEM_OFF, |
mbed_official | 277:0dffe5d9e928 | 87 | SD_POWER_RESET_REASON_GET, |
mbed_official | 277:0dffe5d9e928 | 88 | SD_POWER_RESET_REASON_CLR, |
mbed_official | 277:0dffe5d9e928 | 89 | SD_POWER_POF_ENABLE, |
mbed_official | 277:0dffe5d9e928 | 90 | SD_POWER_POF_THRESHOLD_SET, |
mbed_official | 277:0dffe5d9e928 | 91 | SD_POWER_RAMON_SET, |
mbed_official | 277:0dffe5d9e928 | 92 | SD_POWER_RAMON_CLR, |
mbed_official | 277:0dffe5d9e928 | 93 | SD_POWER_RAMON_GET, |
mbed_official | 277:0dffe5d9e928 | 94 | SD_POWER_GPREGRET_SET, |
mbed_official | 277:0dffe5d9e928 | 95 | SD_POWER_GPREGRET_CLR, |
mbed_official | 277:0dffe5d9e928 | 96 | SD_POWER_GPREGRET_GET, |
mbed_official | 277:0dffe5d9e928 | 97 | SD_POWER_DCDC_MODE_SET, |
mbed_official | 277:0dffe5d9e928 | 98 | SD_APP_EVT_WAIT, |
mbed_official | 277:0dffe5d9e928 | 99 | SD_CLOCK_HFCLK_REQUEST, |
mbed_official | 277:0dffe5d9e928 | 100 | SD_CLOCK_HFCLK_RELEASE, |
mbed_official | 277:0dffe5d9e928 | 101 | SD_CLOCK_HFCLK_IS_RUNNING, |
mbed_official | 277:0dffe5d9e928 | 102 | SD_PPI_CHANNEL_ENABLE_GET, |
mbed_official | 277:0dffe5d9e928 | 103 | SD_PPI_CHANNEL_ENABLE_SET, |
mbed_official | 277:0dffe5d9e928 | 104 | SD_PPI_CHANNEL_ENABLE_CLR, |
mbed_official | 277:0dffe5d9e928 | 105 | SD_PPI_CHANNEL_ASSIGN, |
mbed_official | 277:0dffe5d9e928 | 106 | SD_PPI_GROUP_TASK_ENABLE, |
mbed_official | 277:0dffe5d9e928 | 107 | SD_PPI_GROUP_TASK_DISABLE, |
mbed_official | 277:0dffe5d9e928 | 108 | SD_PPI_GROUP_ASSIGN, |
mbed_official | 277:0dffe5d9e928 | 109 | SD_PPI_GROUP_GET, |
mbed_official | 277:0dffe5d9e928 | 110 | SD_RADIO_NOTIFICATION_CFG_SET, |
mbed_official | 277:0dffe5d9e928 | 111 | SD_ECB_BLOCK_ENCRYPT, |
mbed_official | 277:0dffe5d9e928 | 112 | SD_RADIO_SESSION_OPEN, |
mbed_official | 277:0dffe5d9e928 | 113 | SD_RADIO_SESSION_CLOSE, |
mbed_official | 277:0dffe5d9e928 | 114 | SD_RADIO_REQUEST, |
mbed_official | 277:0dffe5d9e928 | 115 | SD_EVT_GET, |
mbed_official | 277:0dffe5d9e928 | 116 | SD_TEMP_GET, |
mbed_official | 277:0dffe5d9e928 | 117 | SVC_SOC_LAST |
mbed_official | 277:0dffe5d9e928 | 118 | }; |
mbed_official | 277:0dffe5d9e928 | 119 | |
mbed_official | 277:0dffe5d9e928 | 120 | /**@brief Possible values of a ::nrf_mutex_t. */ |
mbed_official | 277:0dffe5d9e928 | 121 | enum NRF_MUTEX_VALUES |
mbed_official | 277:0dffe5d9e928 | 122 | { |
mbed_official | 277:0dffe5d9e928 | 123 | NRF_MUTEX_FREE, |
mbed_official | 277:0dffe5d9e928 | 124 | NRF_MUTEX_TAKEN |
mbed_official | 277:0dffe5d9e928 | 125 | }; |
mbed_official | 277:0dffe5d9e928 | 126 | |
mbed_official | 277:0dffe5d9e928 | 127 | /**@brief Possible values of ::nrf_app_irq_priority_t. */ |
mbed_official | 277:0dffe5d9e928 | 128 | enum NRF_APP_PRIORITIES |
mbed_official | 277:0dffe5d9e928 | 129 | { |
mbed_official | 277:0dffe5d9e928 | 130 | NRF_APP_PRIORITY_HIGH = 1, |
mbed_official | 277:0dffe5d9e928 | 131 | NRF_APP_PRIORITY_LOW = 3 |
mbed_official | 277:0dffe5d9e928 | 132 | }; |
mbed_official | 277:0dffe5d9e928 | 133 | |
mbed_official | 277:0dffe5d9e928 | 134 | /**@brief Possible values of ::nrf_power_mode_t. */ |
mbed_official | 277:0dffe5d9e928 | 135 | enum NRF_POWER_MODES |
mbed_official | 277:0dffe5d9e928 | 136 | { |
mbed_official | 277:0dffe5d9e928 | 137 | NRF_POWER_MODE_CONSTLAT, /**< Constant latency mode. See power management in the reference manual. */ |
mbed_official | 277:0dffe5d9e928 | 138 | NRF_POWER_MODE_LOWPWR /**< Low power mode. See power management in the reference manual. */ |
mbed_official | 277:0dffe5d9e928 | 139 | }; |
mbed_official | 277:0dffe5d9e928 | 140 | |
mbed_official | 277:0dffe5d9e928 | 141 | |
mbed_official | 277:0dffe5d9e928 | 142 | /**@brief Possible values of ::nrf_power_failure_threshold_t */ |
mbed_official | 277:0dffe5d9e928 | 143 | enum NRF_POWER_THRESHOLDS |
mbed_official | 277:0dffe5d9e928 | 144 | { |
mbed_official | 277:0dffe5d9e928 | 145 | NRF_POWER_THRESHOLD_V21, /**< 2.1 Volts power failure threshold. */ |
mbed_official | 277:0dffe5d9e928 | 146 | NRF_POWER_THRESHOLD_V23, /**< 2.3 Volts power failure threshold. */ |
mbed_official | 277:0dffe5d9e928 | 147 | NRF_POWER_THRESHOLD_V25, /**< 2.5 Volts power failure threshold. */ |
mbed_official | 277:0dffe5d9e928 | 148 | NRF_POWER_THRESHOLD_V27 /**< 2.7 Volts power failure threshold. */ |
mbed_official | 277:0dffe5d9e928 | 149 | }; |
mbed_official | 277:0dffe5d9e928 | 150 | |
mbed_official | 277:0dffe5d9e928 | 151 | |
mbed_official | 277:0dffe5d9e928 | 152 | /**@brief Possible values of ::nrf_power_dcdc_mode_t. */ |
mbed_official | 277:0dffe5d9e928 | 153 | enum NRF_POWER_DCDC_MODES |
mbed_official | 277:0dffe5d9e928 | 154 | { |
mbed_official | 277:0dffe5d9e928 | 155 | NRF_POWER_DCDC_MODE_OFF, /**< The DCDC is always off. */ |
mbed_official | 277:0dffe5d9e928 | 156 | NRF_POWER_DCDC_MODE_ON, /**< The DCDC is always on. */ |
mbed_official | 277:0dffe5d9e928 | 157 | NRF_POWER_DCDC_MODE_AUTOMATIC /**< The DCDC is automatically managed. */ |
mbed_official | 277:0dffe5d9e928 | 158 | }; |
mbed_official | 277:0dffe5d9e928 | 159 | |
mbed_official | 277:0dffe5d9e928 | 160 | /**@brief Possible values of ::nrf_radio_notification_distance_t. */ |
mbed_official | 277:0dffe5d9e928 | 161 | enum NRF_RADIO_NOTIFICATION_DISTANCES |
mbed_official | 277:0dffe5d9e928 | 162 | { |
mbed_official | 277:0dffe5d9e928 | 163 | NRF_RADIO_NOTIFICATION_DISTANCE_NONE = 0, /**< The event does not have a notification. */ |
mbed_official | 277:0dffe5d9e928 | 164 | NRF_RADIO_NOTIFICATION_DISTANCE_800US, /**< The distance from the active notification to start of radio activity. */ |
mbed_official | 277:0dffe5d9e928 | 165 | NRF_RADIO_NOTIFICATION_DISTANCE_1740US, /**< The distance from the active notification to start of radio activity. */ |
mbed_official | 277:0dffe5d9e928 | 166 | NRF_RADIO_NOTIFICATION_DISTANCE_2680US, /**< The distance from the active notification to start of radio activity. */ |
mbed_official | 277:0dffe5d9e928 | 167 | NRF_RADIO_NOTIFICATION_DISTANCE_3620US, /**< The distance from the active notification to start of radio activity. */ |
mbed_official | 277:0dffe5d9e928 | 168 | NRF_RADIO_NOTIFICATION_DISTANCE_4560US, /**< The distance from the active notification to start of radio activity. */ |
mbed_official | 277:0dffe5d9e928 | 169 | NRF_RADIO_NOTIFICATION_DISTANCE_5500US /**< The distance from the active notification to start of radio activity. */ |
mbed_official | 277:0dffe5d9e928 | 170 | }; |
mbed_official | 277:0dffe5d9e928 | 171 | |
mbed_official | 277:0dffe5d9e928 | 172 | |
mbed_official | 277:0dffe5d9e928 | 173 | /**@brief Possible values of ::nrf_radio_notification_type_t. */ |
mbed_official | 277:0dffe5d9e928 | 174 | enum NRF_RADIO_NOTIFICATION_TYPES |
mbed_official | 277:0dffe5d9e928 | 175 | { |
mbed_official | 277:0dffe5d9e928 | 176 | NRF_RADIO_NOTIFICATION_TYPE_NONE = 0, /**< The event does not have a radio notification signal. */ |
mbed_official | 277:0dffe5d9e928 | 177 | NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE, /**< Using interrupt for notification when the radio will be enabled. */ |
mbed_official | 277:0dffe5d9e928 | 178 | NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE, /**< Using interrupt for notification when the radio has been disabled. */ |
mbed_official | 277:0dffe5d9e928 | 179 | NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH, /**< Using interrupt for notification both when the radio will be enabled and disabled. */ |
mbed_official | 277:0dffe5d9e928 | 180 | }; |
mbed_official | 277:0dffe5d9e928 | 181 | |
mbed_official | 277:0dffe5d9e928 | 182 | /**@brief SoC Events. */ |
mbed_official | 277:0dffe5d9e928 | 183 | enum NRF_SOC_EVTS |
mbed_official | 277:0dffe5d9e928 | 184 | { |
mbed_official | 277:0dffe5d9e928 | 185 | NRF_EVT_HFCLKSTARTED, /**< Event indicating that the HFCLK has started. */ |
mbed_official | 277:0dffe5d9e928 | 186 | NRF_EVT_POWER_FAILURE_WARNING, /**< Event indicating that a power failure warning has occurred. */ |
mbed_official | 277:0dffe5d9e928 | 187 | NRF_EVT_FLASH_OPERATION_SUCCESS, /**< Event indicating that the ongoing flash operation has completed successfully. */ |
mbed_official | 277:0dffe5d9e928 | 188 | NRF_EVT_FLASH_OPERATION_ERROR, /**< Event indicating that the ongoing flash operation has timed out with an error. */ |
mbed_official | 277:0dffe5d9e928 | 189 | NRF_EVT_RADIO_BLOCKED, /**< Event indicating that a radio timeslot was blocked. */ |
mbed_official | 277:0dffe5d9e928 | 190 | NRF_EVT_RADIO_CANCELED, /**< Event indicating that a radio timeslot was canceled by SoftDevice. */ |
mbed_official | 277:0dffe5d9e928 | 191 | NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN, /**< Event indicating that a radio signal callback handler return was invalid. */ |
mbed_official | 277:0dffe5d9e928 | 192 | NRF_EVT_RADIO_SESSION_IDLE, /**< Event indicating that a radio session is idle. */ |
mbed_official | 277:0dffe5d9e928 | 193 | NRF_EVT_RADIO_SESSION_CLOSED, /**< Event indicating that a radio session is closed. */ |
mbed_official | 277:0dffe5d9e928 | 194 | NRF_EVT_NUMBER_OF_EVTS |
mbed_official | 277:0dffe5d9e928 | 195 | }; |
mbed_official | 277:0dffe5d9e928 | 196 | |
mbed_official | 277:0dffe5d9e928 | 197 | /** @} */ |
mbed_official | 277:0dffe5d9e928 | 198 | |
mbed_official | 277:0dffe5d9e928 | 199 | /** @addtogroup NRF_SOC_TYPES Types |
mbed_official | 277:0dffe5d9e928 | 200 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 201 | |
mbed_official | 277:0dffe5d9e928 | 202 | /**@brief Represents a mutex for use with the nrf_mutex functions. |
mbed_official | 277:0dffe5d9e928 | 203 | * @note Accessing the value directly is not safe, use the mutex functions! |
mbed_official | 277:0dffe5d9e928 | 204 | */ |
mbed_official | 277:0dffe5d9e928 | 205 | typedef volatile uint8_t nrf_mutex_t; |
mbed_official | 277:0dffe5d9e928 | 206 | |
mbed_official | 277:0dffe5d9e928 | 207 | /**@brief The interrupt priorities available to the application while the softdevice is active. */ |
mbed_official | 277:0dffe5d9e928 | 208 | typedef uint8_t nrf_app_irq_priority_t; |
mbed_official | 277:0dffe5d9e928 | 209 | |
mbed_official | 277:0dffe5d9e928 | 210 | /**@brief Represents a power mode, used in power mode functions */ |
mbed_official | 277:0dffe5d9e928 | 211 | typedef uint8_t nrf_power_mode_t; |
mbed_official | 277:0dffe5d9e928 | 212 | |
mbed_official | 277:0dffe5d9e928 | 213 | /**@brief Represents a power failure threshold value. */ |
mbed_official | 277:0dffe5d9e928 | 214 | typedef uint8_t nrf_power_failure_threshold_t; |
mbed_official | 277:0dffe5d9e928 | 215 | |
mbed_official | 277:0dffe5d9e928 | 216 | /**@brief Represents a DCDC mode value. */ |
mbed_official | 277:0dffe5d9e928 | 217 | typedef uint32_t nrf_power_dcdc_mode_t; |
mbed_official | 277:0dffe5d9e928 | 218 | |
mbed_official | 277:0dffe5d9e928 | 219 | /**@brief Radio notification distances. */ |
mbed_official | 277:0dffe5d9e928 | 220 | typedef uint8_t nrf_radio_notification_distance_t; |
mbed_official | 277:0dffe5d9e928 | 221 | |
mbed_official | 277:0dffe5d9e928 | 222 | /**@brief Radio notification types. */ |
mbed_official | 277:0dffe5d9e928 | 223 | typedef uint8_t nrf_radio_notification_type_t; |
mbed_official | 277:0dffe5d9e928 | 224 | |
mbed_official | 277:0dffe5d9e928 | 225 | /** @brief The Radio signal callback types. */ |
mbed_official | 277:0dffe5d9e928 | 226 | enum NRF_RADIO_CALLBACK_SIGNAL_TYPE |
mbed_official | 277:0dffe5d9e928 | 227 | { |
mbed_official | 277:0dffe5d9e928 | 228 | NRF_RADIO_CALLBACK_SIGNAL_TYPE_START, /**< This signal indicates the start of the radio timeslot. */ |
mbed_official | 277:0dffe5d9e928 | 229 | NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0, /**< This signal indicates the NRF_TIMER0 interrupt. */ |
mbed_official | 277:0dffe5d9e928 | 230 | NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO, /**< This signal indicates the NRF_RADIO interrupt. */ |
mbed_official | 277:0dffe5d9e928 | 231 | NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED, /**< This signal indicates extend action failed. */ |
mbed_official | 277:0dffe5d9e928 | 232 | NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED /**< This signal indicates extend action succeeded. */ |
mbed_official | 277:0dffe5d9e928 | 233 | }; |
mbed_official | 277:0dffe5d9e928 | 234 | |
mbed_official | 277:0dffe5d9e928 | 235 | /** @brief The actions requested by the signal callback. |
mbed_official | 277:0dffe5d9e928 | 236 | * |
mbed_official | 277:0dffe5d9e928 | 237 | * This code gives the SOC instructions about what action to take when the signal callback has |
mbed_official | 277:0dffe5d9e928 | 238 | * returned. |
mbed_official | 277:0dffe5d9e928 | 239 | */ |
mbed_official | 277:0dffe5d9e928 | 240 | enum NRF_RADIO_SIGNAL_CALLBACK_ACTION |
mbed_official | 277:0dffe5d9e928 | 241 | { |
mbed_official | 277:0dffe5d9e928 | 242 | NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE, /**< Return without action. */ |
mbed_official | 277:0dffe5d9e928 | 243 | NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND, /**< Request an extension of the current timeslot (maximum execution time for this action is when the extension succeeded). */ |
mbed_official | 277:0dffe5d9e928 | 244 | NRF_RADIO_SIGNAL_CALLBACK_ACTION_END, /**< End the current radio timeslot. */ |
mbed_official | 277:0dffe5d9e928 | 245 | NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END /**< Request a new radio timeslot and end the current timeslot. */ |
mbed_official | 277:0dffe5d9e928 | 246 | }; |
mbed_official | 277:0dffe5d9e928 | 247 | |
mbed_official | 277:0dffe5d9e928 | 248 | /**@brief Radio timeslot high frequency clock source configuration. */ |
mbed_official | 277:0dffe5d9e928 | 249 | enum NRF_RADIO_HFCLK_CFG |
mbed_official | 277:0dffe5d9e928 | 250 | { |
mbed_official | 277:0dffe5d9e928 | 251 | NRF_RADIO_HFCLK_CFG_DEFAULT, /**< Use the currently selected oscillator as HF clock source during the timeslot (i.e. the source is not specified). */ |
mbed_official | 277:0dffe5d9e928 | 252 | NRF_RADIO_HFCLK_CFG_FORCE_XTAL, /**< Force external crystal to be used as HF clock source during whole the timeslot. */ |
mbed_official | 277:0dffe5d9e928 | 253 | }; |
mbed_official | 277:0dffe5d9e928 | 254 | |
mbed_official | 277:0dffe5d9e928 | 255 | /** @brief Radio timeslot priorities. */ |
mbed_official | 277:0dffe5d9e928 | 256 | enum NRF_RADIO_PRIORITY |
mbed_official | 277:0dffe5d9e928 | 257 | { |
mbed_official | 277:0dffe5d9e928 | 258 | NRF_RADIO_PRIORITY_HIGH, /**< High (equal priority as the normal connection priority of the SoftDevice stack(s)). */ |
mbed_official | 277:0dffe5d9e928 | 259 | NRF_RADIO_PRIORITY_NORMAL, /**< Normal (equal priority as the priority of secondary activites of the SoftDevice stack(s)). */ |
mbed_official | 277:0dffe5d9e928 | 260 | }; |
mbed_official | 277:0dffe5d9e928 | 261 | |
mbed_official | 277:0dffe5d9e928 | 262 | /** @brief Radio timeslot request type. */ |
mbed_official | 277:0dffe5d9e928 | 263 | enum NRF_RADIO_REQUEST_TYPE |
mbed_official | 277:0dffe5d9e928 | 264 | { |
mbed_official | 277:0dffe5d9e928 | 265 | NRF_RADIO_REQ_TYPE_EARLIEST, /**< Request timeslot as early as possible. This should always be used for the first request in a session. */ |
mbed_official | 277:0dffe5d9e928 | 266 | NRF_RADIO_REQ_TYPE_NORMAL /**< Normal timeslot request. */ |
mbed_official | 277:0dffe5d9e928 | 267 | }; |
mbed_official | 277:0dffe5d9e928 | 268 | |
mbed_official | 277:0dffe5d9e928 | 269 | /** @brief Parameters for a request for a timeslot as early as possible. */ |
mbed_official | 277:0dffe5d9e928 | 270 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 271 | { |
mbed_official | 277:0dffe5d9e928 | 272 | uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */ |
mbed_official | 277:0dffe5d9e928 | 273 | uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */ |
mbed_official | 277:0dffe5d9e928 | 274 | uint32_t length_us; /**< The radio timeslot length (in the range 100 to 100,000] microseconds). */ |
mbed_official | 277:0dffe5d9e928 | 275 | uint32_t timeout_us; /**< Longest acceptable delay until the start of the requested timeslot (up to @ref NRF_RADIO_EARLIEST_TIMEOUT_MAX_US microseconds). */ |
mbed_official | 277:0dffe5d9e928 | 276 | } nrf_radio_request_earliest_t; |
mbed_official | 277:0dffe5d9e928 | 277 | |
mbed_official | 277:0dffe5d9e928 | 278 | /** @brief Parameters for a normal radio request. */ |
mbed_official | 277:0dffe5d9e928 | 279 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 280 | { |
mbed_official | 277:0dffe5d9e928 | 281 | uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */ |
mbed_official | 277:0dffe5d9e928 | 282 | uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */ |
mbed_official | 277:0dffe5d9e928 | 283 | uint32_t distance_us; /**< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds). */ |
mbed_official | 277:0dffe5d9e928 | 284 | uint32_t length_us; /**< The radio timeslot length (in the range [100..100,000] microseconds). */ |
mbed_official | 277:0dffe5d9e928 | 285 | } nrf_radio_request_normal_t; |
mbed_official | 277:0dffe5d9e928 | 286 | |
mbed_official | 277:0dffe5d9e928 | 287 | /** @brief Radio request parameters. */ |
mbed_official | 277:0dffe5d9e928 | 288 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 289 | { |
mbed_official | 277:0dffe5d9e928 | 290 | uint8_t request_type; /**< Type of request, see @ref NRF_RADIO_REQUEST_TYPE. */ |
mbed_official | 277:0dffe5d9e928 | 291 | union |
mbed_official | 277:0dffe5d9e928 | 292 | { |
mbed_official | 277:0dffe5d9e928 | 293 | nrf_radio_request_earliest_t earliest; /**< Parameters for a request for a timeslot as early as possible. */ |
mbed_official | 277:0dffe5d9e928 | 294 | nrf_radio_request_normal_t normal; /**< Parameters for a normal radio request. */ |
mbed_official | 277:0dffe5d9e928 | 295 | } params; |
mbed_official | 277:0dffe5d9e928 | 296 | } nrf_radio_request_t; |
mbed_official | 277:0dffe5d9e928 | 297 | |
mbed_official | 277:0dffe5d9e928 | 298 | /**@brief Return parameters of the radio timeslot signal callback. */ |
mbed_official | 277:0dffe5d9e928 | 299 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 300 | { |
mbed_official | 277:0dffe5d9e928 | 301 | uint8_t callback_action; /**< The action requested by the application when returning from the signal callback, see @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION. */ |
mbed_official | 277:0dffe5d9e928 | 302 | union |
mbed_official | 277:0dffe5d9e928 | 303 | { |
mbed_official | 277:0dffe5d9e928 | 304 | struct |
mbed_official | 277:0dffe5d9e928 | 305 | { |
mbed_official | 277:0dffe5d9e928 | 306 | nrf_radio_request_t * p_next; /**< The request parameters for the next radio timeslot. */ |
mbed_official | 277:0dffe5d9e928 | 307 | } request; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END. */ |
mbed_official | 277:0dffe5d9e928 | 308 | struct |
mbed_official | 277:0dffe5d9e928 | 309 | { |
mbed_official | 277:0dffe5d9e928 | 310 | uint32_t length_us; /**< Requested extension of the timeslot duration (microseconds) (for minimum time see @ref NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US). */ |
mbed_official | 277:0dffe5d9e928 | 311 | } extend; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND. */ |
mbed_official | 277:0dffe5d9e928 | 312 | } params; |
mbed_official | 277:0dffe5d9e928 | 313 | } nrf_radio_signal_callback_return_param_t; |
mbed_official | 277:0dffe5d9e928 | 314 | |
mbed_official | 277:0dffe5d9e928 | 315 | /**@brief The radio signal callback type. |
mbed_official | 277:0dffe5d9e928 | 316 | * |
mbed_official | 277:0dffe5d9e928 | 317 | * @note In case of invalid return parameters, the radio timeslot will automatically end |
mbed_official | 277:0dffe5d9e928 | 318 | * immediately after returning from the signal callback and the |
mbed_official | 277:0dffe5d9e928 | 319 | * @ref NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN event will be sent. |
mbed_official | 277:0dffe5d9e928 | 320 | * @note The returned struct pointer must remain valid after the signal callback |
mbed_official | 277:0dffe5d9e928 | 321 | * function returns. For instance, this means that it must not point to a stack variable. |
mbed_official | 277:0dffe5d9e928 | 322 | * |
mbed_official | 277:0dffe5d9e928 | 323 | * @param[in] signal_type Type of signal, see @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE. |
mbed_official | 277:0dffe5d9e928 | 324 | * |
mbed_official | 277:0dffe5d9e928 | 325 | * @return Pointer to structure containing action requested by the application. |
mbed_official | 277:0dffe5d9e928 | 326 | */ |
mbed_official | 277:0dffe5d9e928 | 327 | typedef nrf_radio_signal_callback_return_param_t * (*nrf_radio_signal_callback_t) (uint8_t signal_type); |
mbed_official | 277:0dffe5d9e928 | 328 | |
mbed_official | 277:0dffe5d9e928 | 329 | /**@brief AES ECB data structure */ |
mbed_official | 277:0dffe5d9e928 | 330 | typedef struct |
mbed_official | 277:0dffe5d9e928 | 331 | { |
mbed_official | 277:0dffe5d9e928 | 332 | uint8_t key[SOC_ECB_KEY_LENGTH]; /**< Encryption key. */ |
mbed_official | 277:0dffe5d9e928 | 333 | uint8_t cleartext[SOC_ECB_CLEARTEXT_LENGTH]; /**< Clear Text data. */ |
mbed_official | 277:0dffe5d9e928 | 334 | uint8_t ciphertext[SOC_ECB_CIPHERTEXT_LENGTH]; /**< Cipher Text data. */ |
mbed_official | 277:0dffe5d9e928 | 335 | } nrf_ecb_hal_data_t; |
mbed_official | 277:0dffe5d9e928 | 336 | |
mbed_official | 277:0dffe5d9e928 | 337 | /** @} */ |
mbed_official | 277:0dffe5d9e928 | 338 | |
mbed_official | 277:0dffe5d9e928 | 339 | /** @addtogroup NRF_SOC_FUNCTIONS Functions |
mbed_official | 277:0dffe5d9e928 | 340 | * @{ */ |
mbed_official | 277:0dffe5d9e928 | 341 | |
mbed_official | 277:0dffe5d9e928 | 342 | /**@brief Initialize a mutex. |
mbed_official | 277:0dffe5d9e928 | 343 | * |
mbed_official | 277:0dffe5d9e928 | 344 | * @param[in] p_mutex Pointer to the mutex to initialize. |
mbed_official | 277:0dffe5d9e928 | 345 | * |
mbed_official | 277:0dffe5d9e928 | 346 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 347 | */ |
mbed_official | 277:0dffe5d9e928 | 348 | SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex)); |
mbed_official | 277:0dffe5d9e928 | 349 | |
mbed_official | 277:0dffe5d9e928 | 350 | /**@brief Attempt to acquire a mutex. |
mbed_official | 277:0dffe5d9e928 | 351 | * |
mbed_official | 277:0dffe5d9e928 | 352 | * @param[in] p_mutex Pointer to the mutex to acquire. |
mbed_official | 277:0dffe5d9e928 | 353 | * |
mbed_official | 277:0dffe5d9e928 | 354 | * @retval ::NRF_SUCCESS The mutex was successfully acquired. |
mbed_official | 277:0dffe5d9e928 | 355 | * @retval ::NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN The mutex could not be acquired. |
mbed_official | 277:0dffe5d9e928 | 356 | */ |
mbed_official | 277:0dffe5d9e928 | 357 | SVCALL(SD_MUTEX_ACQUIRE, uint32_t, sd_mutex_acquire(nrf_mutex_t * p_mutex)); |
mbed_official | 277:0dffe5d9e928 | 358 | |
mbed_official | 277:0dffe5d9e928 | 359 | /**@brief Release a mutex. |
mbed_official | 277:0dffe5d9e928 | 360 | * |
mbed_official | 277:0dffe5d9e928 | 361 | * @param[in] p_mutex Pointer to the mutex to release. |
mbed_official | 277:0dffe5d9e928 | 362 | * |
mbed_official | 277:0dffe5d9e928 | 363 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 364 | */ |
mbed_official | 277:0dffe5d9e928 | 365 | SVCALL(SD_MUTEX_RELEASE, uint32_t, sd_mutex_release(nrf_mutex_t * p_mutex)); |
mbed_official | 277:0dffe5d9e928 | 366 | |
mbed_official | 277:0dffe5d9e928 | 367 | /**@brief Enable External Interrupt. |
mbed_official | 277:0dffe5d9e928 | 368 | * @note Corresponds to NVIC_EnableIRQ in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 369 | * |
mbed_official | 277:0dffe5d9e928 | 370 | * @pre{IRQn is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 371 | * |
mbed_official | 277:0dffe5d9e928 | 372 | * @param[in] IRQn See the NVIC_EnableIRQ documentation in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 373 | * |
mbed_official | 277:0dffe5d9e928 | 374 | * @retval ::NRF_SUCCESS The interrupt was enabled. |
mbed_official | 277:0dffe5d9e928 | 375 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 376 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt has a priority not available for the application. |
mbed_official | 277:0dffe5d9e928 | 377 | */ |
mbed_official | 277:0dffe5d9e928 | 378 | SVCALL(SD_NVIC_ENABLEIRQ, uint32_t, sd_nvic_EnableIRQ(IRQn_Type IRQn)); |
mbed_official | 277:0dffe5d9e928 | 379 | |
mbed_official | 277:0dffe5d9e928 | 380 | /**@brief Disable External Interrupt. |
mbed_official | 277:0dffe5d9e928 | 381 | * @note Corresponds to NVIC_DisableIRQ in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 382 | * |
mbed_official | 277:0dffe5d9e928 | 383 | * @pre{IRQn is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 384 | * |
mbed_official | 277:0dffe5d9e928 | 385 | * @param[in] IRQn See the NVIC_DisableIRQ documentation in CMSIS |
mbed_official | 277:0dffe5d9e928 | 386 | * |
mbed_official | 277:0dffe5d9e928 | 387 | * @retval ::NRF_SUCCESS The interrupt was disabled. |
mbed_official | 277:0dffe5d9e928 | 388 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 389 | */ |
mbed_official | 277:0dffe5d9e928 | 390 | SVCALL(SD_NVIC_DISABLEIRQ, uint32_t, sd_nvic_DisableIRQ(IRQn_Type IRQn)); |
mbed_official | 277:0dffe5d9e928 | 391 | |
mbed_official | 277:0dffe5d9e928 | 392 | /**@brief Get Pending Interrupt. |
mbed_official | 277:0dffe5d9e928 | 393 | * @note Corresponds to NVIC_GetPendingIRQ in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 394 | * |
mbed_official | 277:0dffe5d9e928 | 395 | * @pre{IRQn is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 396 | * |
mbed_official | 277:0dffe5d9e928 | 397 | * @param[in] IRQn See the NVIC_GetPendingIRQ documentation in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 398 | * @param[out] p_pending_irq Return value from NVIC_GetPendingIRQ. |
mbed_official | 277:0dffe5d9e928 | 399 | * |
mbed_official | 277:0dffe5d9e928 | 400 | * @retval ::NRF_SUCCESS The interrupt is available for the application. |
mbed_official | 277:0dffe5d9e928 | 401 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 402 | */ |
mbed_official | 277:0dffe5d9e928 | 403 | SVCALL(SD_NVIC_GETPENDINGIRQ, uint32_t, sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq)); |
mbed_official | 277:0dffe5d9e928 | 404 | |
mbed_official | 277:0dffe5d9e928 | 405 | /**@brief Set Pending Interrupt. |
mbed_official | 277:0dffe5d9e928 | 406 | * @note Corresponds to NVIC_SetPendingIRQ in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 407 | * |
mbed_official | 277:0dffe5d9e928 | 408 | * @pre{IRQn is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 409 | * |
mbed_official | 277:0dffe5d9e928 | 410 | * @param[in] IRQn See the NVIC_SetPendingIRQ documentation in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 411 | * |
mbed_official | 277:0dffe5d9e928 | 412 | * @retval ::NRF_SUCCESS The interrupt is set pending. |
mbed_official | 277:0dffe5d9e928 | 413 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 414 | */ |
mbed_official | 277:0dffe5d9e928 | 415 | SVCALL(SD_NVIC_SETPENDINGIRQ, uint32_t, sd_nvic_SetPendingIRQ(IRQn_Type IRQn)); |
mbed_official | 277:0dffe5d9e928 | 416 | |
mbed_official | 277:0dffe5d9e928 | 417 | /**@brief Clear Pending Interrupt. |
mbed_official | 277:0dffe5d9e928 | 418 | * @note Corresponds to NVIC_ClearPendingIRQ in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 419 | * |
mbed_official | 277:0dffe5d9e928 | 420 | * @pre{IRQn is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 421 | * |
mbed_official | 277:0dffe5d9e928 | 422 | * @param[in] IRQn See the NVIC_ClearPendingIRQ documentation in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 423 | * |
mbed_official | 277:0dffe5d9e928 | 424 | * @retval ::NRF_SUCCESS The interrupt pending flag is cleared. |
mbed_official | 277:0dffe5d9e928 | 425 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 426 | */ |
mbed_official | 277:0dffe5d9e928 | 427 | SVCALL(SD_NVIC_CLEARPENDINGIRQ, uint32_t, sd_nvic_ClearPendingIRQ(IRQn_Type IRQn)); |
mbed_official | 277:0dffe5d9e928 | 428 | |
mbed_official | 277:0dffe5d9e928 | 429 | /**@brief Set Interrupt Priority. |
mbed_official | 277:0dffe5d9e928 | 430 | * @note Corresponds to NVIC_SetPriority in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 431 | * |
mbed_official | 277:0dffe5d9e928 | 432 | * @pre{IRQn is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 433 | * @pre{priority is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 434 | * |
mbed_official | 277:0dffe5d9e928 | 435 | * @param[in] IRQn See the NVIC_SetPriority documentation in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 436 | * @param[in] priority A valid IRQ priority for use by the application. |
mbed_official | 277:0dffe5d9e928 | 437 | * |
mbed_official | 277:0dffe5d9e928 | 438 | * @retval ::NRF_SUCCESS The interrupt and priority level is available for the application. |
mbed_official | 277:0dffe5d9e928 | 439 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 440 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt priority is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 441 | */ |
mbed_official | 277:0dffe5d9e928 | 442 | SVCALL(SD_NVIC_SETPRIORITY, uint32_t, sd_nvic_SetPriority(IRQn_Type IRQn, nrf_app_irq_priority_t priority)); |
mbed_official | 277:0dffe5d9e928 | 443 | |
mbed_official | 277:0dffe5d9e928 | 444 | /**@brief Get Interrupt Priority. |
mbed_official | 277:0dffe5d9e928 | 445 | * @note Corresponds to NVIC_GetPriority in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 446 | * |
mbed_official | 277:0dffe5d9e928 | 447 | * @pre{IRQn is valid and not reserved by the stack} |
mbed_official | 277:0dffe5d9e928 | 448 | * |
mbed_official | 277:0dffe5d9e928 | 449 | * @param[in] IRQn See the NVIC_GetPriority documentation in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 450 | * @param[out] p_priority Return value from NVIC_GetPriority. |
mbed_official | 277:0dffe5d9e928 | 451 | * |
mbed_official | 277:0dffe5d9e928 | 452 | * @retval ::NRF_SUCCESS The interrupt priority is returned in p_priority. |
mbed_official | 277:0dffe5d9e928 | 453 | * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - IRQn is not available for the application. |
mbed_official | 277:0dffe5d9e928 | 454 | */ |
mbed_official | 277:0dffe5d9e928 | 455 | SVCALL(SD_NVIC_GETPRIORITY, uint32_t, sd_nvic_GetPriority(IRQn_Type IRQn, nrf_app_irq_priority_t * p_priority)); |
mbed_official | 277:0dffe5d9e928 | 456 | |
mbed_official | 277:0dffe5d9e928 | 457 | /**@brief System Reset. |
mbed_official | 277:0dffe5d9e928 | 458 | * @note Corresponds to NVIC_SystemReset in CMSIS. |
mbed_official | 277:0dffe5d9e928 | 459 | * |
mbed_official | 277:0dffe5d9e928 | 460 | * @retval ::NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN |
mbed_official | 277:0dffe5d9e928 | 461 | */ |
mbed_official | 277:0dffe5d9e928 | 462 | SVCALL(SD_NVIC_SYSTEMRESET, uint32_t, sd_nvic_SystemReset(void)); |
mbed_official | 277:0dffe5d9e928 | 463 | |
mbed_official | 277:0dffe5d9e928 | 464 | /**@brief Enters critical region. |
mbed_official | 277:0dffe5d9e928 | 465 | * |
mbed_official | 277:0dffe5d9e928 | 466 | * @post Application interrupts will be disabled. |
mbed_official | 277:0dffe5d9e928 | 467 | * @sa sd_nvic_critical_region_exit |
mbed_official | 277:0dffe5d9e928 | 468 | * |
mbed_official | 277:0dffe5d9e928 | 469 | * @param[out] p_is_nested_critical_region 1: If in a nested critical region. |
mbed_official | 277:0dffe5d9e928 | 470 | * 0: Otherwise. |
mbed_official | 277:0dffe5d9e928 | 471 | * |
mbed_official | 277:0dffe5d9e928 | 472 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 473 | */ |
mbed_official | 277:0dffe5d9e928 | 474 | SVCALL(SD_NVIC_CRITICAL_REGION_ENTER, uint32_t, sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region)); |
mbed_official | 277:0dffe5d9e928 | 475 | |
mbed_official | 277:0dffe5d9e928 | 476 | /**@brief Exit critical region. |
mbed_official | 277:0dffe5d9e928 | 477 | * |
mbed_official | 277:0dffe5d9e928 | 478 | * @pre Application has entered a critical region using ::sd_nvic_critical_region_enter. |
mbed_official | 277:0dffe5d9e928 | 479 | * @post If not in a nested critical region, the application interrupts will restored to the state before ::sd_nvic_critical_region_enter was called. |
mbed_official | 277:0dffe5d9e928 | 480 | * |
mbed_official | 277:0dffe5d9e928 | 481 | * @param[in] is_nested_critical_region If this is set to 1, the critical region won't be exited. @sa sd_nvic_critical_region_enter. |
mbed_official | 277:0dffe5d9e928 | 482 | * |
mbed_official | 277:0dffe5d9e928 | 483 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 484 | */ |
mbed_official | 277:0dffe5d9e928 | 485 | SVCALL(SD_NVIC_CRITICAL_REGION_EXIT, uint32_t, sd_nvic_critical_region_exit(uint8_t is_nested_critical_region)); |
mbed_official | 277:0dffe5d9e928 | 486 | |
mbed_official | 277:0dffe5d9e928 | 487 | /**@brief Query the capacity of the application random pool. |
mbed_official | 277:0dffe5d9e928 | 488 | * |
mbed_official | 277:0dffe5d9e928 | 489 | * @param[out] p_pool_capacity The capacity of the pool. |
mbed_official | 277:0dffe5d9e928 | 490 | * |
mbed_official | 277:0dffe5d9e928 | 491 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 492 | */ |
mbed_official | 277:0dffe5d9e928 | 493 | SVCALL(SD_RAND_APPLICATION_POOL_CAPACITY, uint32_t, sd_rand_application_pool_capacity_get(uint8_t * p_pool_capacity)); |
mbed_official | 277:0dffe5d9e928 | 494 | |
mbed_official | 277:0dffe5d9e928 | 495 | /**@brief Get number of random bytes available to the application. |
mbed_official | 277:0dffe5d9e928 | 496 | * |
mbed_official | 277:0dffe5d9e928 | 497 | * @param[out] p_bytes_available The number of bytes currently available in the pool. |
mbed_official | 277:0dffe5d9e928 | 498 | * |
mbed_official | 277:0dffe5d9e928 | 499 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 500 | */ |
mbed_official | 277:0dffe5d9e928 | 501 | SVCALL(SD_RAND_APPLICATION_BYTES_AVAILABLE, uint32_t, sd_rand_application_bytes_available_get(uint8_t * p_bytes_available)); |
mbed_official | 277:0dffe5d9e928 | 502 | |
mbed_official | 277:0dffe5d9e928 | 503 | /**@brief Get random bytes from the application pool. |
mbed_official | 277:0dffe5d9e928 | 504 | * |
mbed_official | 277:0dffe5d9e928 | 505 | * @param[out] p_buff Pointer to unit8_t buffer for storing the bytes. |
mbed_official | 277:0dffe5d9e928 | 506 | * @param[in] length Number of bytes to take from pool and place in p_buff. |
mbed_official | 277:0dffe5d9e928 | 507 | * |
mbed_official | 277:0dffe5d9e928 | 508 | * @retval ::NRF_SUCCESS The requested bytes were written to p_buff. |
mbed_official | 277:0dffe5d9e928 | 509 | * @retval ::NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES No bytes were written to the buffer, because there were not enough bytes available. |
mbed_official | 277:0dffe5d9e928 | 510 | */ |
mbed_official | 277:0dffe5d9e928 | 511 | SVCALL(SD_RAND_APPLICATION_GET_VECTOR, uint32_t, sd_rand_application_vector_get(uint8_t * p_buff, uint8_t length)); |
mbed_official | 277:0dffe5d9e928 | 512 | |
mbed_official | 277:0dffe5d9e928 | 513 | /**@brief Gets the reset reason register. |
mbed_official | 277:0dffe5d9e928 | 514 | * |
mbed_official | 277:0dffe5d9e928 | 515 | * @param[out] p_reset_reason Contents of the NRF_POWER->RESETREAS register. |
mbed_official | 277:0dffe5d9e928 | 516 | * |
mbed_official | 277:0dffe5d9e928 | 517 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 518 | */ |
mbed_official | 277:0dffe5d9e928 | 519 | SVCALL(SD_POWER_RESET_REASON_GET, uint32_t, sd_power_reset_reason_get(uint32_t * p_reset_reason)); |
mbed_official | 277:0dffe5d9e928 | 520 | |
mbed_official | 277:0dffe5d9e928 | 521 | /**@brief Clears the bits of the reset reason register. |
mbed_official | 277:0dffe5d9e928 | 522 | * |
mbed_official | 277:0dffe5d9e928 | 523 | * @param[in] reset_reason_clr_msk Contains the bits to clear from the reset reason register. |
mbed_official | 277:0dffe5d9e928 | 524 | * |
mbed_official | 277:0dffe5d9e928 | 525 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 526 | */ |
mbed_official | 277:0dffe5d9e928 | 527 | SVCALL(SD_POWER_RESET_REASON_CLR, uint32_t, sd_power_reset_reason_clr(uint32_t reset_reason_clr_msk)); |
mbed_official | 277:0dffe5d9e928 | 528 | |
mbed_official | 277:0dffe5d9e928 | 529 | /**@brief Sets the power mode when in CPU sleep. |
mbed_official | 277:0dffe5d9e928 | 530 | * |
mbed_official | 277:0dffe5d9e928 | 531 | * @param[in] power_mode The power mode to use when in CPU sleep. @sa sd_app_evt_wait |
mbed_official | 277:0dffe5d9e928 | 532 | * |
mbed_official | 277:0dffe5d9e928 | 533 | * @retval ::NRF_SUCCESS The power mode was set. |
mbed_official | 277:0dffe5d9e928 | 534 | * @retval ::NRF_ERROR_SOC_POWER_MODE_UNKNOWN The power mode was unknown. |
mbed_official | 277:0dffe5d9e928 | 535 | */ |
mbed_official | 277:0dffe5d9e928 | 536 | SVCALL(SD_POWER_MODE_SET, uint32_t, sd_power_mode_set(nrf_power_mode_t power_mode)); |
mbed_official | 277:0dffe5d9e928 | 537 | |
mbed_official | 277:0dffe5d9e928 | 538 | /**@brief Puts the chip in System OFF mode. |
mbed_official | 277:0dffe5d9e928 | 539 | * |
mbed_official | 277:0dffe5d9e928 | 540 | * @retval ::NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN |
mbed_official | 277:0dffe5d9e928 | 541 | */ |
mbed_official | 277:0dffe5d9e928 | 542 | SVCALL(SD_POWER_SYSTEM_OFF, uint32_t, sd_power_system_off(void)); |
mbed_official | 277:0dffe5d9e928 | 543 | |
mbed_official | 277:0dffe5d9e928 | 544 | /**@brief Enables or disables the power-fail comparator. |
mbed_official | 277:0dffe5d9e928 | 545 | * |
mbed_official | 277:0dffe5d9e928 | 546 | * Enabling this will give a softdevice event (NRF_EVT_POWER_FAILURE_WARNING) when the power failure warning occurs. |
mbed_official | 277:0dffe5d9e928 | 547 | * The event can be retrieved with sd_evt_get(); |
mbed_official | 277:0dffe5d9e928 | 548 | * |
mbed_official | 277:0dffe5d9e928 | 549 | * @param[in] pof_enable True if the power-fail comparator should be enabled, false if it should be disabled. |
mbed_official | 277:0dffe5d9e928 | 550 | * |
mbed_official | 277:0dffe5d9e928 | 551 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 552 | */ |
mbed_official | 277:0dffe5d9e928 | 553 | SVCALL(SD_POWER_POF_ENABLE, uint32_t, sd_power_pof_enable(uint8_t pof_enable)); |
mbed_official | 277:0dffe5d9e928 | 554 | |
mbed_official | 277:0dffe5d9e928 | 555 | /**@brief Sets the power-fail threshold value. |
mbed_official | 277:0dffe5d9e928 | 556 | * |
mbed_official | 277:0dffe5d9e928 | 557 | * @param[in] threshold The power-fail threshold value to use. |
mbed_official | 277:0dffe5d9e928 | 558 | * |
mbed_official | 277:0dffe5d9e928 | 559 | * @retval ::NRF_SUCCESS The power failure threshold was set. |
mbed_official | 277:0dffe5d9e928 | 560 | * @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown. |
mbed_official | 277:0dffe5d9e928 | 561 | */ |
mbed_official | 277:0dffe5d9e928 | 562 | SVCALL(SD_POWER_POF_THRESHOLD_SET, uint32_t, sd_power_pof_threshold_set(nrf_power_failure_threshold_t threshold)); |
mbed_official | 277:0dffe5d9e928 | 563 | |
mbed_official | 277:0dffe5d9e928 | 564 | /**@brief Sets bits in the NRF_POWER->RAMON register. |
mbed_official | 277:0dffe5d9e928 | 565 | * |
mbed_official | 277:0dffe5d9e928 | 566 | * @param[in] ramon Contains the bits needed to be set in the NRF_POWER->RAMON register. |
mbed_official | 277:0dffe5d9e928 | 567 | * |
mbed_official | 277:0dffe5d9e928 | 568 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 569 | */ |
mbed_official | 277:0dffe5d9e928 | 570 | SVCALL(SD_POWER_RAMON_SET, uint32_t, sd_power_ramon_set(uint32_t ramon)); |
mbed_official | 277:0dffe5d9e928 | 571 | |
mbed_official | 277:0dffe5d9e928 | 572 | /** @brief Clears bits in the NRF_POWER->RAMON register. |
mbed_official | 277:0dffe5d9e928 | 573 | * |
mbed_official | 277:0dffe5d9e928 | 574 | * @param ramon Contains the bits needed to be cleared in the NRF_POWER->RAMON register. |
mbed_official | 277:0dffe5d9e928 | 575 | * |
mbed_official | 277:0dffe5d9e928 | 576 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 577 | */ |
mbed_official | 277:0dffe5d9e928 | 578 | SVCALL(SD_POWER_RAMON_CLR, uint32_t, sd_power_ramon_clr(uint32_t ramon)); |
mbed_official | 277:0dffe5d9e928 | 579 | |
mbed_official | 277:0dffe5d9e928 | 580 | /**@brief Get contents of NRF_POWER->RAMON register, indicates power status of ram blocks. |
mbed_official | 277:0dffe5d9e928 | 581 | * |
mbed_official | 277:0dffe5d9e928 | 582 | * @param[out] p_ramon Content of NRF_POWER->RAMON register. |
mbed_official | 277:0dffe5d9e928 | 583 | * |
mbed_official | 277:0dffe5d9e928 | 584 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 585 | */ |
mbed_official | 277:0dffe5d9e928 | 586 | SVCALL(SD_POWER_RAMON_GET, uint32_t, sd_power_ramon_get(uint32_t * p_ramon)); |
mbed_official | 277:0dffe5d9e928 | 587 | |
mbed_official | 277:0dffe5d9e928 | 588 | /**@brief Set bits in the NRF_POWER->GPREGRET register. |
mbed_official | 277:0dffe5d9e928 | 589 | * |
mbed_official | 277:0dffe5d9e928 | 590 | * @param[in] gpregret_msk Bits to be set in the GPREGRET register. |
mbed_official | 277:0dffe5d9e928 | 591 | * |
mbed_official | 277:0dffe5d9e928 | 592 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 593 | */ |
mbed_official | 277:0dffe5d9e928 | 594 | SVCALL(SD_POWER_GPREGRET_SET, uint32_t, sd_power_gpregret_set(uint32_t gpregret_msk)); |
mbed_official | 277:0dffe5d9e928 | 595 | |
mbed_official | 277:0dffe5d9e928 | 596 | /**@brief Clear bits in the NRF_POWER->GPREGRET register. |
mbed_official | 277:0dffe5d9e928 | 597 | * |
mbed_official | 277:0dffe5d9e928 | 598 | * @param[in] gpregret_msk Bits to be clear in the GPREGRET register. |
mbed_official | 277:0dffe5d9e928 | 599 | * |
mbed_official | 277:0dffe5d9e928 | 600 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 601 | */ |
mbed_official | 277:0dffe5d9e928 | 602 | SVCALL(SD_POWER_GPREGRET_CLR, uint32_t, sd_power_gpregret_clr(uint32_t gpregret_msk)); |
mbed_official | 277:0dffe5d9e928 | 603 | |
mbed_official | 277:0dffe5d9e928 | 604 | /**@brief Get contents of the NRF_POWER->GPREGRET register. |
mbed_official | 277:0dffe5d9e928 | 605 | * |
mbed_official | 277:0dffe5d9e928 | 606 | * @param[out] p_gpregret Contents of the GPREGRET register. |
mbed_official | 277:0dffe5d9e928 | 607 | * |
mbed_official | 277:0dffe5d9e928 | 608 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 609 | */ |
mbed_official | 277:0dffe5d9e928 | 610 | SVCALL(SD_POWER_GPREGRET_GET, uint32_t, sd_power_gpregret_get(uint32_t *p_gpregret)); |
mbed_official | 277:0dffe5d9e928 | 611 | |
mbed_official | 277:0dffe5d9e928 | 612 | /**@brief Sets the DCDC mode. |
mbed_official | 277:0dffe5d9e928 | 613 | * |
mbed_official | 277:0dffe5d9e928 | 614 | * Depending on the internal state of the SoftDevice, the mode change may not happen immediately. |
mbed_official | 277:0dffe5d9e928 | 615 | * The DCDC mode switch will be blocked when occurring in close proximity to radio transmissions. When |
mbed_official | 277:0dffe5d9e928 | 616 | * the radio transmission is done, the last mode will be used. |
mbed_official | 277:0dffe5d9e928 | 617 | * |
mbed_official | 277:0dffe5d9e928 | 618 | * @param[in] dcdc_mode The mode of the DCDC. |
mbed_official | 277:0dffe5d9e928 | 619 | * |
mbed_official | 277:0dffe5d9e928 | 620 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 621 | * @retval ::NRF_ERROR_INVALID_PARAM The DCDC mode is invalid. |
mbed_official | 277:0dffe5d9e928 | 622 | */ |
mbed_official | 277:0dffe5d9e928 | 623 | SVCALL(SD_POWER_DCDC_MODE_SET, uint32_t, sd_power_dcdc_mode_set(nrf_power_dcdc_mode_t dcdc_mode)); |
mbed_official | 277:0dffe5d9e928 | 624 | |
mbed_official | 277:0dffe5d9e928 | 625 | /**@brief Request the high frequency crystal oscillator. |
mbed_official | 277:0dffe5d9e928 | 626 | * |
mbed_official | 277:0dffe5d9e928 | 627 | * Will start the high frequency crystal oscillator, the startup time of the crystal varies |
mbed_official | 277:0dffe5d9e928 | 628 | * and the ::sd_clock_hfclk_is_running function can be polled to check if it has started. |
mbed_official | 277:0dffe5d9e928 | 629 | * |
mbed_official | 277:0dffe5d9e928 | 630 | * @see sd_clock_hfclk_is_running |
mbed_official | 277:0dffe5d9e928 | 631 | * @see sd_clock_hfclk_release |
mbed_official | 277:0dffe5d9e928 | 632 | * |
mbed_official | 277:0dffe5d9e928 | 633 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 634 | */ |
mbed_official | 277:0dffe5d9e928 | 635 | SVCALL(SD_CLOCK_HFCLK_REQUEST, uint32_t, sd_clock_hfclk_request(void)); |
mbed_official | 277:0dffe5d9e928 | 636 | |
mbed_official | 277:0dffe5d9e928 | 637 | /**@brief Releases the high frequency crystal oscillator. |
mbed_official | 277:0dffe5d9e928 | 638 | * |
mbed_official | 277:0dffe5d9e928 | 639 | * Will stop the high frequency crystal oscillator, this happens immediately. |
mbed_official | 277:0dffe5d9e928 | 640 | * |
mbed_official | 277:0dffe5d9e928 | 641 | * @see sd_clock_hfclk_is_running |
mbed_official | 277:0dffe5d9e928 | 642 | * @see sd_clock_hfclk_request |
mbed_official | 277:0dffe5d9e928 | 643 | * |
mbed_official | 277:0dffe5d9e928 | 644 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 645 | */ |
mbed_official | 277:0dffe5d9e928 | 646 | SVCALL(SD_CLOCK_HFCLK_RELEASE, uint32_t, sd_clock_hfclk_release(void)); |
mbed_official | 277:0dffe5d9e928 | 647 | |
mbed_official | 277:0dffe5d9e928 | 648 | /**@brief Checks if the high frequency crystal oscillator is running. |
mbed_official | 277:0dffe5d9e928 | 649 | * |
mbed_official | 277:0dffe5d9e928 | 650 | * @see sd_clock_hfclk_request |
mbed_official | 277:0dffe5d9e928 | 651 | * @see sd_clock_hfclk_release |
mbed_official | 277:0dffe5d9e928 | 652 | * |
mbed_official | 277:0dffe5d9e928 | 653 | * @param[out] p_is_running 1 if the external crystal oscillator is running, 0 if not. |
mbed_official | 277:0dffe5d9e928 | 654 | * |
mbed_official | 277:0dffe5d9e928 | 655 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 656 | */ |
mbed_official | 277:0dffe5d9e928 | 657 | SVCALL(SD_CLOCK_HFCLK_IS_RUNNING, uint32_t, sd_clock_hfclk_is_running(uint32_t * p_is_running)); |
mbed_official | 277:0dffe5d9e928 | 658 | |
mbed_official | 277:0dffe5d9e928 | 659 | /**@brief Waits for an application event. |
mbed_official | 277:0dffe5d9e928 | 660 | * |
mbed_official | 277:0dffe5d9e928 | 661 | * An application event is either an application interrupt or a pended interrupt when the |
mbed_official | 277:0dffe5d9e928 | 662 | * interrupt is disabled. When the interrupt is enabled it will be taken immediately since |
mbed_official | 277:0dffe5d9e928 | 663 | * this function will wait in thread mode, then the execution will return in the application's |
mbed_official | 277:0dffe5d9e928 | 664 | * main thread. When an interrupt is disabled and gets pended it will return to the application's |
mbed_official | 277:0dffe5d9e928 | 665 | * thread main. The application must ensure that the pended flag is cleared using |
mbed_official | 277:0dffe5d9e928 | 666 | * ::sd_nvic_ClearPendingIRQ in order to sleep using this function. This is only necessary for |
mbed_official | 277:0dffe5d9e928 | 667 | * disabled interrupts, as the interrupt handler will clear the pending flag automatically for |
mbed_official | 277:0dffe5d9e928 | 668 | * enabled interrupts. |
mbed_official | 277:0dffe5d9e928 | 669 | * |
mbed_official | 277:0dffe5d9e928 | 670 | * In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M0 |
mbed_official | 277:0dffe5d9e928 | 671 | * System Control Register (SCR). @sa CMSIS_SCB |
mbed_official | 277:0dffe5d9e928 | 672 | * |
mbed_official | 277:0dffe5d9e928 | 673 | * @note If an application interrupt has happened since the last time sd_app_evt_wait was |
mbed_official | 277:0dffe5d9e928 | 674 | * called this function will return immediately and not go to sleep. This is to avoid race |
mbed_official | 277:0dffe5d9e928 | 675 | * conditions that can occur when a flag is updated in the interrupt handler and processed |
mbed_official | 277:0dffe5d9e928 | 676 | * in the main loop. |
mbed_official | 277:0dffe5d9e928 | 677 | * |
mbed_official | 277:0dffe5d9e928 | 678 | * @post An application interrupt has happened or a interrupt pending flag is set. |
mbed_official | 277:0dffe5d9e928 | 679 | * |
mbed_official | 277:0dffe5d9e928 | 680 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 681 | */ |
mbed_official | 277:0dffe5d9e928 | 682 | SVCALL(SD_APP_EVT_WAIT, uint32_t, sd_app_evt_wait(void)); |
mbed_official | 277:0dffe5d9e928 | 683 | |
mbed_official | 277:0dffe5d9e928 | 684 | /**@brief Get PPI channel enable register contents. |
mbed_official | 277:0dffe5d9e928 | 685 | * |
mbed_official | 277:0dffe5d9e928 | 686 | * @param[out] p_channel_enable The contents of the PPI CHEN register. |
mbed_official | 277:0dffe5d9e928 | 687 | * |
mbed_official | 277:0dffe5d9e928 | 688 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 689 | */ |
mbed_official | 277:0dffe5d9e928 | 690 | SVCALL(SD_PPI_CHANNEL_ENABLE_GET, uint32_t, sd_ppi_channel_enable_get(uint32_t * p_channel_enable)); |
mbed_official | 277:0dffe5d9e928 | 691 | |
mbed_official | 277:0dffe5d9e928 | 692 | /**@brief Set PPI channel enable register. |
mbed_official | 277:0dffe5d9e928 | 693 | * |
mbed_official | 277:0dffe5d9e928 | 694 | * @param[in] channel_enable_set_msk Mask containing the bits to set in the PPI CHEN register. |
mbed_official | 277:0dffe5d9e928 | 695 | * |
mbed_official | 277:0dffe5d9e928 | 696 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 697 | */ |
mbed_official | 277:0dffe5d9e928 | 698 | SVCALL(SD_PPI_CHANNEL_ENABLE_SET, uint32_t, sd_ppi_channel_enable_set(uint32_t channel_enable_set_msk)); |
mbed_official | 277:0dffe5d9e928 | 699 | |
mbed_official | 277:0dffe5d9e928 | 700 | /**@brief Clear PPI channel enable register. |
mbed_official | 277:0dffe5d9e928 | 701 | * |
mbed_official | 277:0dffe5d9e928 | 702 | * @param[in] channel_enable_clr_msk Mask containing the bits to clear in the PPI CHEN register. |
mbed_official | 277:0dffe5d9e928 | 703 | * |
mbed_official | 277:0dffe5d9e928 | 704 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 705 | */ |
mbed_official | 277:0dffe5d9e928 | 706 | SVCALL(SD_PPI_CHANNEL_ENABLE_CLR, uint32_t, sd_ppi_channel_enable_clr(uint32_t channel_enable_clr_msk)); |
mbed_official | 277:0dffe5d9e928 | 707 | |
mbed_official | 277:0dffe5d9e928 | 708 | /**@brief Assign endpoints to a PPI channel. |
mbed_official | 277:0dffe5d9e928 | 709 | * |
mbed_official | 277:0dffe5d9e928 | 710 | * @param[in] channel_num Number of the PPI channel to assign. |
mbed_official | 277:0dffe5d9e928 | 711 | * @param[in] evt_endpoint Event endpoint of the PPI channel. |
mbed_official | 277:0dffe5d9e928 | 712 | * @param[in] task_endpoint Task endpoint of the PPI channel. |
mbed_official | 277:0dffe5d9e928 | 713 | * |
mbed_official | 277:0dffe5d9e928 | 714 | * @retval ::NRF_ERROR_SOC_PPI_INVALID_CHANNEL The channel number is invalid. |
mbed_official | 277:0dffe5d9e928 | 715 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 716 | */ |
mbed_official | 277:0dffe5d9e928 | 717 | SVCALL(SD_PPI_CHANNEL_ASSIGN, uint32_t, sd_ppi_channel_assign(uint8_t channel_num, const volatile void * evt_endpoint, const volatile void * task_endpoint)); |
mbed_official | 277:0dffe5d9e928 | 718 | |
mbed_official | 277:0dffe5d9e928 | 719 | /**@brief Task to enable a channel group. |
mbed_official | 277:0dffe5d9e928 | 720 | * |
mbed_official | 277:0dffe5d9e928 | 721 | * @param[in] group_num Number of the channel group. |
mbed_official | 277:0dffe5d9e928 | 722 | * |
mbed_official | 277:0dffe5d9e928 | 723 | * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid |
mbed_official | 277:0dffe5d9e928 | 724 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 725 | */ |
mbed_official | 277:0dffe5d9e928 | 726 | SVCALL(SD_PPI_GROUP_TASK_ENABLE, uint32_t, sd_ppi_group_task_enable(uint8_t group_num)); |
mbed_official | 277:0dffe5d9e928 | 727 | |
mbed_official | 277:0dffe5d9e928 | 728 | /**@brief Task to disable a channel group. |
mbed_official | 277:0dffe5d9e928 | 729 | * |
mbed_official | 277:0dffe5d9e928 | 730 | * @param[in] group_num Number of the PPI group. |
mbed_official | 277:0dffe5d9e928 | 731 | * |
mbed_official | 277:0dffe5d9e928 | 732 | * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. |
mbed_official | 277:0dffe5d9e928 | 733 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 734 | */ |
mbed_official | 277:0dffe5d9e928 | 735 | SVCALL(SD_PPI_GROUP_TASK_DISABLE, uint32_t, sd_ppi_group_task_disable(uint8_t group_num)); |
mbed_official | 277:0dffe5d9e928 | 736 | |
mbed_official | 277:0dffe5d9e928 | 737 | /**@brief Assign PPI channels to a channel group. |
mbed_official | 277:0dffe5d9e928 | 738 | * |
mbed_official | 277:0dffe5d9e928 | 739 | * @param[in] group_num Number of the channel group. |
mbed_official | 277:0dffe5d9e928 | 740 | * @param[in] channel_msk Mask of the channels to assign to the group. |
mbed_official | 277:0dffe5d9e928 | 741 | * |
mbed_official | 277:0dffe5d9e928 | 742 | * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. |
mbed_official | 277:0dffe5d9e928 | 743 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 744 | */ |
mbed_official | 277:0dffe5d9e928 | 745 | SVCALL(SD_PPI_GROUP_ASSIGN, uint32_t, sd_ppi_group_assign(uint8_t group_num, uint32_t channel_msk)); |
mbed_official | 277:0dffe5d9e928 | 746 | |
mbed_official | 277:0dffe5d9e928 | 747 | /**@brief Gets the PPI channels of a channel group. |
mbed_official | 277:0dffe5d9e928 | 748 | * |
mbed_official | 277:0dffe5d9e928 | 749 | * @param[in] group_num Number of the channel group. |
mbed_official | 277:0dffe5d9e928 | 750 | * @param[out] p_channel_msk Mask of the channels assigned to the group. |
mbed_official | 277:0dffe5d9e928 | 751 | * |
mbed_official | 277:0dffe5d9e928 | 752 | * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. |
mbed_official | 277:0dffe5d9e928 | 753 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 754 | */ |
mbed_official | 277:0dffe5d9e928 | 755 | SVCALL(SD_PPI_GROUP_GET, uint32_t, sd_ppi_group_get(uint8_t group_num, uint32_t * p_channel_msk)); |
mbed_official | 277:0dffe5d9e928 | 756 | |
mbed_official | 277:0dffe5d9e928 | 757 | /**@brief Configures the Radio Notification signal. |
mbed_official | 277:0dffe5d9e928 | 758 | * |
mbed_official | 277:0dffe5d9e928 | 759 | * @note |
mbed_official | 277:0dffe5d9e928 | 760 | * - The notification signal latency depends on the interrupt priority settings of SWI used |
mbed_official | 277:0dffe5d9e928 | 761 | * for notification signal. |
mbed_official | 277:0dffe5d9e928 | 762 | * - In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice |
mbed_official | 277:0dffe5d9e928 | 763 | * will interrupt the application to do Radio Event preparation. |
mbed_official | 277:0dffe5d9e928 | 764 | * - Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have |
mbed_official | 277:0dffe5d9e928 | 765 | * to shorten the connection events to have time for the Radio Notification signals. |
mbed_official | 277:0dffe5d9e928 | 766 | * |
mbed_official | 277:0dffe5d9e928 | 767 | * @param[in] type Type of notification signal. |
mbed_official | 277:0dffe5d9e928 | 768 | * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio |
mbed_official | 277:0dffe5d9e928 | 769 | * notification. Using @ref NRF_RADIO_NOTIFICATION_DISTANCE_NONE is |
mbed_official | 277:0dffe5d9e928 | 770 | * recommended (but not required) to be used with |
mbed_official | 277:0dffe5d9e928 | 771 | * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE. |
mbed_official | 277:0dffe5d9e928 | 772 | * |
mbed_official | 277:0dffe5d9e928 | 773 | * @param[in] distance Distance between the notification signal and start of radio activity. |
mbed_official | 277:0dffe5d9e928 | 774 | * This parameter is ignored when @ref NRF_RADIO_NOTIFICATION_TYPE_NONE or |
mbed_official | 277:0dffe5d9e928 | 775 | * @ref NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used. |
mbed_official | 277:0dffe5d9e928 | 776 | * |
mbed_official | 277:0dffe5d9e928 | 777 | * @retval ::NRF_ERROR_INVALID_PARAM The group number is invalid. |
mbed_official | 277:0dffe5d9e928 | 778 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 779 | */ |
mbed_official | 277:0dffe5d9e928 | 780 | SVCALL(SD_RADIO_NOTIFICATION_CFG_SET, uint32_t, sd_radio_notification_cfg_set(nrf_radio_notification_type_t type, nrf_radio_notification_distance_t distance)); |
mbed_official | 277:0dffe5d9e928 | 781 | |
mbed_official | 277:0dffe5d9e928 | 782 | /**@brief Encrypts a block according to the specified parameters. |
mbed_official | 277:0dffe5d9e928 | 783 | * |
mbed_official | 277:0dffe5d9e928 | 784 | * 128-bit AES encryption. |
mbed_official | 277:0dffe5d9e928 | 785 | * |
mbed_official | 277:0dffe5d9e928 | 786 | * @param[in, out] p_ecb_data Pointer to the ECB parameters' struct (two input |
mbed_official | 277:0dffe5d9e928 | 787 | * parameters and one output parameter). |
mbed_official | 277:0dffe5d9e928 | 788 | * |
mbed_official | 277:0dffe5d9e928 | 789 | * @retval ::NRF_SUCCESS |
mbed_official | 277:0dffe5d9e928 | 790 | */ |
mbed_official | 277:0dffe5d9e928 | 791 | SVCALL(SD_ECB_BLOCK_ENCRYPT, uint32_t, sd_ecb_block_encrypt(nrf_ecb_hal_data_t * p_ecb_data)); |
mbed_official | 277:0dffe5d9e928 | 792 | |
mbed_official | 277:0dffe5d9e928 | 793 | /**@brief Gets any pending events generated by the SoC API. |
mbed_official | 277:0dffe5d9e928 | 794 | * |
mbed_official | 277:0dffe5d9e928 | 795 | * The application should keep calling this function to get events, until ::NRF_ERROR_NOT_FOUND is returned. |
mbed_official | 277:0dffe5d9e928 | 796 | * |
mbed_official | 277:0dffe5d9e928 | 797 | * @param[out] p_evt_id Set to one of the values in @ref NRF_SOC_EVTS, if any events are pending. |
mbed_official | 277:0dffe5d9e928 | 798 | * |
mbed_official | 277:0dffe5d9e928 | 799 | * @retval ::NRF_SUCCESS An event was pending. The event id is written in the p_evt_id parameter. |
mbed_official | 277:0dffe5d9e928 | 800 | * @retval ::NRF_ERROR_NOT_FOUND No pending events. |
mbed_official | 277:0dffe5d9e928 | 801 | */ |
mbed_official | 277:0dffe5d9e928 | 802 | SVCALL(SD_EVT_GET, uint32_t, sd_evt_get(uint32_t * p_evt_id)); |
mbed_official | 277:0dffe5d9e928 | 803 | |
mbed_official | 277:0dffe5d9e928 | 804 | /**@brief Get the temperature measured on the chip |
mbed_official | 277:0dffe5d9e928 | 805 | * |
mbed_official | 277:0dffe5d9e928 | 806 | * This function will block until the temperature measurement is done. |
mbed_official | 277:0dffe5d9e928 | 807 | * It takes around 50us from call to return. |
mbed_official | 277:0dffe5d9e928 | 808 | * |
mbed_official | 277:0dffe5d9e928 | 809 | * @note Pan #28 in PAN-028 v 1.6 "Negative measured values are not represented correctly" is corrected by this function. |
mbed_official | 277:0dffe5d9e928 | 810 | * |
mbed_official | 277:0dffe5d9e928 | 811 | * @param[out] p_temp Result of temperature measurement. Die temperature in 0.25 degrees celsius. |
mbed_official | 277:0dffe5d9e928 | 812 | * |
mbed_official | 277:0dffe5d9e928 | 813 | * @retval ::NRF_SUCCESS A temperature measurement was done, and the temperature was written to temp |
mbed_official | 277:0dffe5d9e928 | 814 | */ |
mbed_official | 277:0dffe5d9e928 | 815 | SVCALL(SD_TEMP_GET, uint32_t, sd_temp_get(int32_t * p_temp)); |
mbed_official | 277:0dffe5d9e928 | 816 | |
mbed_official | 277:0dffe5d9e928 | 817 | /**@brief Flash Write |
mbed_official | 277:0dffe5d9e928 | 818 | * |
mbed_official | 277:0dffe5d9e928 | 819 | * Commands to write a buffer to flash |
mbed_official | 277:0dffe5d9e928 | 820 | * |
mbed_official | 277:0dffe5d9e928 | 821 | * This call initiates the flash access command, and its completion will be communicated to the |
mbed_official | 277:0dffe5d9e928 | 822 | * application with exactly one of the following events: |
mbed_official | 277:0dffe5d9e928 | 823 | * - NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed. |
mbed_official | 277:0dffe5d9e928 | 824 | * - NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started. |
mbed_official | 277:0dffe5d9e928 | 825 | * |
mbed_official | 277:0dffe5d9e928 | 826 | * @note |
mbed_official | 277:0dffe5d9e928 | 827 | * - This call takes control over the radio and the CPU during flash erase and write to make sure that |
mbed_official | 277:0dffe5d9e928 | 828 | * they will not interfere with the flash access. This means that all interrupts will be blocked |
mbed_official | 277:0dffe5d9e928 | 829 | * for a predictable time (depending on the NVMC specification in nRF51 Series Reference Manual |
mbed_official | 277:0dffe5d9e928 | 830 | * and the command parameters). |
mbed_official | 277:0dffe5d9e928 | 831 | * |
mbed_official | 277:0dffe5d9e928 | 832 | * |
mbed_official | 277:0dffe5d9e928 | 833 | * @param[in] p_dst Pointer to start of flash location to be written. |
mbed_official | 277:0dffe5d9e928 | 834 | * @param[in] p_src Pointer to buffer with data to be written |
mbed_official | 277:0dffe5d9e928 | 835 | * @param[in] size Number of 32-bit words to write. Maximum size is 256 32bit words. |
mbed_official | 277:0dffe5d9e928 | 836 | * |
mbed_official | 277:0dffe5d9e928 | 837 | * @retval ::NRF_ERROR_INVALID_ADDR Tried to write to a non existing flash address, or p_dst or p_src was unaligned. |
mbed_official | 277:0dffe5d9e928 | 838 | * @retval ::NRF_ERROR_BUSY The previous command has not yet completed. |
mbed_official | 277:0dffe5d9e928 | 839 | * @retval ::NRF_ERROR_INVALID_LENGTH Size was 0, or more than 256 words. |
mbed_official | 277:0dffe5d9e928 | 840 | * @retval ::NRF_ERROR_FORBIDDEN Tried to write to or read from protected location. |
mbed_official | 277:0dffe5d9e928 | 841 | * @retval ::NRF_SUCCESS The command was accepted. |
mbed_official | 277:0dffe5d9e928 | 842 | */ |
mbed_official | 277:0dffe5d9e928 | 843 | SVCALL(SD_FLASH_WRITE, uint32_t, sd_flash_write(uint32_t * const p_dst, uint32_t const * const p_src, uint32_t size)); |
mbed_official | 277:0dffe5d9e928 | 844 | |
mbed_official | 277:0dffe5d9e928 | 845 | |
mbed_official | 277:0dffe5d9e928 | 846 | /**@brief Flash Erase page |
mbed_official | 277:0dffe5d9e928 | 847 | * |
mbed_official | 277:0dffe5d9e928 | 848 | * Commands to erase a flash page |
mbed_official | 277:0dffe5d9e928 | 849 | * |
mbed_official | 277:0dffe5d9e928 | 850 | * This call initiates the flash access command, and its completion will be communicated to the |
mbed_official | 277:0dffe5d9e928 | 851 | * application with exactly one of the following events: |
mbed_official | 277:0dffe5d9e928 | 852 | * - NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed. |
mbed_official | 277:0dffe5d9e928 | 853 | * - NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started. |
mbed_official | 277:0dffe5d9e928 | 854 | * |
mbed_official | 277:0dffe5d9e928 | 855 | * @note |
mbed_official | 277:0dffe5d9e928 | 856 | * - This call takes control over the radio and the CPU during flash erase and write to make sure that |
mbed_official | 277:0dffe5d9e928 | 857 | * they will not interfere with the flash access. This means that all interrupts will be blocked |
mbed_official | 277:0dffe5d9e928 | 858 | * for a predictable time (depending on the NVMC specification in nRF51 Series Reference Manual |
mbed_official | 277:0dffe5d9e928 | 859 | * and the command parameters). |
mbed_official | 277:0dffe5d9e928 | 860 | * |
mbed_official | 277:0dffe5d9e928 | 861 | * |
mbed_official | 277:0dffe5d9e928 | 862 | * @param[in] page_number Pagenumber of the page to erase |
mbed_official | 277:0dffe5d9e928 | 863 | * @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error. |
mbed_official | 277:0dffe5d9e928 | 864 | * @retval ::NRF_ERROR_INVALID_ADDR Tried to erase to a non existing flash page. |
mbed_official | 277:0dffe5d9e928 | 865 | * @retval ::NRF_ERROR_BUSY The previous command has not yet completed. |
mbed_official | 277:0dffe5d9e928 | 866 | * @retval ::NRF_ERROR_FORBIDDEN Tried to erase a protected page. |
mbed_official | 277:0dffe5d9e928 | 867 | * @retval ::NRF_SUCCESS The command was accepted. |
mbed_official | 277:0dffe5d9e928 | 868 | */ |
mbed_official | 277:0dffe5d9e928 | 869 | SVCALL(SD_FLASH_PAGE_ERASE, uint32_t, sd_flash_page_erase(uint32_t page_number)); |
mbed_official | 277:0dffe5d9e928 | 870 | |
mbed_official | 277:0dffe5d9e928 | 871 | |
mbed_official | 277:0dffe5d9e928 | 872 | /**@brief Flash Protection set |
mbed_official | 277:0dffe5d9e928 | 873 | * |
mbed_official | 277:0dffe5d9e928 | 874 | * Commands to set the flash protection registers PROTENSETx |
mbed_official | 277:0dffe5d9e928 | 875 | * |
mbed_official | 277:0dffe5d9e928 | 876 | * @note To read the values in PROTENSETx you can read them directly. They are only write-protected. |
mbed_official | 277:0dffe5d9e928 | 877 | * |
mbed_official | 277:0dffe5d9e928 | 878 | * @param[in] protenset0 Value to be written to PROTENSET0 |
mbed_official | 277:0dffe5d9e928 | 879 | * @param[in] protenset1 Value to be written to PROTENSET1 |
mbed_official | 277:0dffe5d9e928 | 880 | * |
mbed_official | 277:0dffe5d9e928 | 881 | * @retval ::NRF_ERROR_FORBIDDEN Tried to protect the SoftDevice |
mbed_official | 277:0dffe5d9e928 | 882 | * @retval ::NRF_SUCCESS Values successfully written to PROTENSETx |
mbed_official | 277:0dffe5d9e928 | 883 | */ |
mbed_official | 277:0dffe5d9e928 | 884 | SVCALL(SD_FLASH_PROTECT, uint32_t, sd_flash_protect(uint32_t protenset0, uint32_t protenset1)); |
mbed_official | 277:0dffe5d9e928 | 885 | |
mbed_official | 277:0dffe5d9e928 | 886 | /**@brief Opens a session for radio requests. |
mbed_official | 277:0dffe5d9e928 | 887 | * |
mbed_official | 277:0dffe5d9e928 | 888 | * @note Only one session can be open at a time. |
mbed_official | 277:0dffe5d9e928 | 889 | * @note p_radio_signal_callback(NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) will be called when the radio timeslot |
mbed_official | 277:0dffe5d9e928 | 890 | * starts. From this point the NRF_RADIO and NRF_TIMER0 peripherals can be freely accessed |
mbed_official | 277:0dffe5d9e928 | 891 | * by the application. |
mbed_official | 277:0dffe5d9e928 | 892 | * @note p_radio_signal_callback(NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0) is called whenever the NRF_TIMER0 |
mbed_official | 277:0dffe5d9e928 | 893 | * interrupt occurs. |
mbed_official | 277:0dffe5d9e928 | 894 | * @note p_radio_signal_callback(NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO) is called whenever the NRF_RADIO |
mbed_official | 277:0dffe5d9e928 | 895 | * interrupt occurs. |
mbed_official | 277:0dffe5d9e928 | 896 | * @note p_radio_signal_callback() will be called at ARM interrupt priority level 0. This |
mbed_official | 277:0dffe5d9e928 | 897 | * implies that none of the sd_* API calls can be used from p_radio_signal_callback(). |
mbed_official | 277:0dffe5d9e928 | 898 | * |
mbed_official | 277:0dffe5d9e928 | 899 | * @param[in] p_radio_signal_callback The signal callback. |
mbed_official | 277:0dffe5d9e928 | 900 | * |
mbed_official | 277:0dffe5d9e928 | 901 | * @retval ::NRF_ERROR_INVALID_ADDR p_radio_signal_callback is an invalid function pointer. |
mbed_official | 277:0dffe5d9e928 | 902 | * @retval ::NRF_ERROR_BUSY If session cannot be opened. |
mbed_official | 277:0dffe5d9e928 | 903 | * @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error. |
mbed_official | 277:0dffe5d9e928 | 904 | * @retval ::NRF_SUCCESS Otherwise. |
mbed_official | 277:0dffe5d9e928 | 905 | */ |
mbed_official | 277:0dffe5d9e928 | 906 | SVCALL(SD_RADIO_SESSION_OPEN, uint32_t, sd_radio_session_open(nrf_radio_signal_callback_t p_radio_signal_callback)); |
mbed_official | 277:0dffe5d9e928 | 907 | |
mbed_official | 277:0dffe5d9e928 | 908 | /**@brief Closes a session for radio requests. |
mbed_official | 277:0dffe5d9e928 | 909 | * |
mbed_official | 277:0dffe5d9e928 | 910 | * @note Any current radio timeslot will be finished before the session is closed. |
mbed_official | 277:0dffe5d9e928 | 911 | * @note If a radio timeslot is scheduled when the session is closed, it will be canceled. |
mbed_official | 277:0dffe5d9e928 | 912 | * @note The application cannot consider the session closed until the NRF_EVT_RADIO_SESSION_CLOSED |
mbed_official | 277:0dffe5d9e928 | 913 | * event is received. |
mbed_official | 277:0dffe5d9e928 | 914 | * |
mbed_official | 277:0dffe5d9e928 | 915 | * @retval ::NRF_ERROR_FORBIDDEN If session not opened. |
mbed_official | 277:0dffe5d9e928 | 916 | * @retval ::NRF_ERROR_BUSY If session is currently being closed. |
mbed_official | 277:0dffe5d9e928 | 917 | * @retval ::NRF_SUCCESS Otherwise. |
mbed_official | 277:0dffe5d9e928 | 918 | */ |
mbed_official | 277:0dffe5d9e928 | 919 | SVCALL(SD_RADIO_SESSION_CLOSE, uint32_t, sd_radio_session_close(void)); |
mbed_official | 277:0dffe5d9e928 | 920 | |
mbed_official | 277:0dffe5d9e928 | 921 | /**@brief Requests a radio timeslot. |
mbed_official | 277:0dffe5d9e928 | 922 | * |
mbed_official | 277:0dffe5d9e928 | 923 | * @note The timing of the radio timeslot is specified by p_request->distance_us. For the first |
mbed_official | 277:0dffe5d9e928 | 924 | * request in a session, p_request->distance_us is required to be 0 by convention, and |
mbed_official | 277:0dffe5d9e928 | 925 | * the timeslot is scheduled at the first possible opportunity. All following radio timeslots are |
mbed_official | 277:0dffe5d9e928 | 926 | * requested with a distance of p_request->distance_us measured from the start of the |
mbed_official | 277:0dffe5d9e928 | 927 | * previous radio timeslot. |
mbed_official | 277:0dffe5d9e928 | 928 | * @note A too small p_request->distance_us will lead to a NRF_EVT_RADIO_BLOCKED event. |
mbed_official | 277:0dffe5d9e928 | 929 | * @note Timeslots scheduled too close will lead to a NRF_EVT_RADIO_BLOCKED event. |
mbed_official | 277:0dffe5d9e928 | 930 | * @note See the SoftDevice Specification for more on radio timeslot scheduling, distances and lengths. |
mbed_official | 277:0dffe5d9e928 | 931 | * @note If an opportunity for the first radio timeslot is not found before 100ms after the call to this |
mbed_official | 277:0dffe5d9e928 | 932 | * function, it is not scheduled, and instead a NRF_EVT_RADIO_BLOCKED event is sent. |
mbed_official | 277:0dffe5d9e928 | 933 | * The application may then try to schedule the first radio timeslot again. |
mbed_official | 277:0dffe5d9e928 | 934 | * @note Successful requests will result in nrf_radio_signal_callback_t(NRF_RADIO_CALLBACK_SIGNAL_TYPE_START). |
mbed_official | 277:0dffe5d9e928 | 935 | * Unsuccessful requests will result in a NRF_EVT_RADIO_BLOCKED event, see @ref NRF_SOC_EVTS. |
mbed_official | 277:0dffe5d9e928 | 936 | * @note The jitter in the start time of the radio timeslots is +/- NRF_RADIO_START_JITTER_US us. |
mbed_official | 277:0dffe5d9e928 | 937 | * @note The nrf_radio_signal_callback_t(NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) call has a latency relative to the |
mbed_official | 277:0dffe5d9e928 | 938 | * specified radio timeslot start, but this does not affect the actual start time of the timeslot. |
mbed_official | 277:0dffe5d9e928 | 939 | * @note NRF_TIMER0 is reset at the start of the radio timeslot, and is clocked at 1MHz from the high frequency |
mbed_official | 277:0dffe5d9e928 | 940 | * (16 MHz) clock source. If p_request->hfclk_force_xtal is true, the high frequency clock is |
mbed_official | 277:0dffe5d9e928 | 941 | * guaranteed to be clocked from the external crystal. |
mbed_official | 277:0dffe5d9e928 | 942 | * @note The SoftDevice will neither access the NRF_RADIO peripheral nor the NRF_TIMER0 peripheral |
mbed_official | 277:0dffe5d9e928 | 943 | * during the radio timeslot. |
mbed_official | 277:0dffe5d9e928 | 944 | * |
mbed_official | 277:0dffe5d9e928 | 945 | * @param[in] p_request Pointer to the request parameters. |
mbed_official | 277:0dffe5d9e928 | 946 | * |
mbed_official | 277:0dffe5d9e928 | 947 | * @retval ::NRF_ERROR_FORBIDDEN If session not opened or the session is not IDLE. |
mbed_official | 277:0dffe5d9e928 | 948 | * @retval ::NRF_ERROR_INVALID_ADDR If the p_request pointer is invalid. |
mbed_official | 277:0dffe5d9e928 | 949 | * @retval ::NRF_ERROR_INVALID_PARAM If the parameters of p_request are not valid. |
mbed_official | 277:0dffe5d9e928 | 950 | * @retval ::NRF_SUCCESS Otherwise. |
mbed_official | 277:0dffe5d9e928 | 951 | */ |
mbed_official | 277:0dffe5d9e928 | 952 | SVCALL(SD_RADIO_REQUEST, uint32_t, sd_radio_request(nrf_radio_request_t * p_request )); |
mbed_official | 277:0dffe5d9e928 | 953 | |
mbed_official | 277:0dffe5d9e928 | 954 | /** @} */ |
mbed_official | 277:0dffe5d9e928 | 955 | |
mbed_official | 277:0dffe5d9e928 | 956 | #endif // NRF_SOC_H__ |
mbed_official | 277:0dffe5d9e928 | 957 | |
mbed_official | 277:0dffe5d9e928 | 958 | /**@} */ |