#define SD_EVT_IRQn (SWI2_IRQn) /**< SoftDevice Event IRQ number. Used for both protocol events and SoC events. */
#define SD_EVT_IRQHandler (SWI2_IRQHandler) /**< SoftDevice Event IRQ handler. Used for both protocol events and SoC events.
The default interrupt priority for this handler is set to 6 */
#define RADIO_NOTIFICATION_IRQn (SWI1_IRQn) /**< The radio notification IRQ number. */
#define RADIO_NOTIFICATION_IRQHandler (SWI1_IRQHandler) /**< The radio notification IRQ handler.
The default interrupt priority for this handler is set to 6 */
#define NRF_RADIO_LENGTH_MIN_US (100) /**< The shortest allowed radio timeslot, in microseconds. */
#define NRF_RADIO_LENGTH_MAX_US (100000) /**< The longest allowed radio timeslot, in microseconds. */
#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. */
#define NRF_RADIO_EARLIEST_TIMEOUT_MAX_US (128000000UL - 1UL) /**< The longest timeout, in microseconds, allowed when requesting the earliest possible timeslot. */
#define NRF_RADIO_START_JITTER_US (2) /**< The maximum jitter in @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START relative to the requested start time. */
/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is disabled. */
NRF_POWER_MODE_CONSTLAT,/**< Constant latency mode. See power management in the reference manual. */
NRF_POWER_MODE_LOWPWR/**< Low power mode. See power management in the reference manual. */
};
/**@brief Power failure thresholds */
enumNRF_POWER_THRESHOLDS
{
NRF_POWER_THRESHOLD_V17=4UL,/**< 1.7 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V18,/**< 1.8 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V19,/**< 1.9 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V20,/**< 2.0 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V21,/**< 2.1 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V22,/**< 2.2 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V23,/**< 2.3 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V24,/**< 2.4 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V25,/**< 2.5 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V26,/**< 2.6 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V27,/**< 2.7 Volts power failure threshold. */
NRF_POWER_THRESHOLD_V28/**< 2.8 Volts power failure threshold. */
};
/**@brief Power failure thresholds for high voltage */
enumNRF_POWER_THRESHOLDVDDHS
{
NRF_POWER_THRESHOLDVDDH_V27,/**< 2.7 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V28,/**< 2.8 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V29,/**< 2.9 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V30,/**< 3.0 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V31,/**< 3.1 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V32,/**< 3.2 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V33,/**< 3.3 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V34,/**< 3.4 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V35,/**< 3.5 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V36,/**< 3.6 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V37,/**< 3.7 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V38,/**< 3.8 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V39,/**< 3.9 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V40,/**< 4.0 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V41,/**< 4.1 Volts power failure threshold. */
NRF_POWER_THRESHOLDVDDH_V42/**< 4.2 Volts power failure threshold. */
};
/**@brief DC/DC converter modes. */
enumNRF_POWER_DCDC_MODES
{
NRF_POWER_DCDC_DISABLE,/**< The DCDC is disabled. */
NRF_POWER_DCDC_ENABLE/**< The DCDC is enabled. */
};
/**@brief Radio notification distances. */
enumNRF_RADIO_NOTIFICATION_DISTANCES
{
NRF_RADIO_NOTIFICATION_DISTANCE_NONE=0,/**< The event does not have a notification. */
NRF_RADIO_NOTIFICATION_DISTANCE_800US,/**< The distance from the active notification to start of radio activity. */
NRF_RADIO_NOTIFICATION_DISTANCE_1740US,/**< The distance from the active notification to start of radio activity. */
NRF_RADIO_NOTIFICATION_DISTANCE_2680US,/**< The distance from the active notification to start of radio activity. */
NRF_RADIO_NOTIFICATION_DISTANCE_3620US,/**< The distance from the active notification to start of radio activity. */
NRF_RADIO_NOTIFICATION_DISTANCE_4560US,/**< The distance from the active notification to start of radio activity. */
NRF_RADIO_NOTIFICATION_DISTANCE_5500US/**< The distance from the active notification to start of radio activity. */
};
/**@brief Radio notification types. */
enumNRF_RADIO_NOTIFICATION_TYPES
{
NRF_RADIO_NOTIFICATION_TYPE_NONE=0,/**< The event does not have a radio notification signal. */
NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE,/**< Using interrupt for notification when the radio will be enabled. */
NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE,/**< Using interrupt for notification when the radio has been disabled. */
NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH,/**< Using interrupt for notification both when the radio will be enabled and disabled. */
};
/**@brief The Radio signal callback types. */
enumNRF_RADIO_CALLBACK_SIGNAL_TYPE
{
NRF_RADIO_CALLBACK_SIGNAL_TYPE_START,/**< This signal indicates the start of the radio timeslot. */
NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0,/**< This signal indicates the NRF_TIMER0 interrupt. */
NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO,/**< This signal indicates the NRF_RADIO interrupt. */
NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED,/**< This signal indicates extend action failed. */
NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED/**< This signal indicates extend action succeeded. */
};
/**@brief The actions requested by the signal callback.
*
* This code gives the SOC instructions about what action to take when the signal callback has
* returned.
*/
enumNRF_RADIO_SIGNAL_CALLBACK_ACTION
{
NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE,/**< Return without action. */
NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND,/**< Request an extension of the current
timeslot. Maximum execution time for this action:
@ref NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US.
This action must be started at least
@ref NRF_RADIO_MIN_EXTENSION_MARGIN_US before
the end of the timeslot. */
NRF_RADIO_SIGNAL_CALLBACK_ACTION_END,/**< End the current radio timeslot. */
NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END/**< Request a new radio timeslot and end the current timeslot. */
};
/**@brief Radio timeslot high frequency clock source configuration. */
enumNRF_RADIO_HFCLK_CFG
{
NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED,/**< The SoftDevice will guarantee that the high frequency clock source is the
external crystal for the whole duration of the timeslot. This should be the
preferred option for events that use the radio or require high timing accuracy.
@note The SoftDevice will automatically turn on and off the external crystal,
at the beginning and end of the timeslot, respectively. The crystal may also
intentionally be left running after the timeslot, in cases where it is needed
by the SoftDevice shortly after the end of the timeslot. */
NRF_RADIO_HFCLK_CFG_NO_GUARANTEE/**< This configuration allows for earlier and tighter scheduling of timeslots.
The RC oscillator may be the clock source in part or for the whole duration of the timeslot.
The RC oscillator's accuracy must therefore be taken into consideration.
@note If the application will use the radio peripheral in timeslots with this configuration,
it must make sure that the crystal is running and stable before starting the radio. */
};
/**@brief Radio timeslot priorities. */
enumNRF_RADIO_PRIORITY
{
NRF_RADIO_PRIORITY_HIGH,/**< High (equal priority as the normal connection priority of the SoftDevice stack(s)). */
NRF_RADIO_PRIORITY_NORMAL,/**< Normal (equal priority as the priority of secondary activities of the SoftDevice stack(s)). */
};
/**@brief Radio timeslot request type. */
enumNRF_RADIO_REQUEST_TYPE
{
NRF_RADIO_REQ_TYPE_EARLIEST,/**< Request radio timeslot as early as possible. This should always be used for the first request in a session. */
NRF_RADIO_REQ_TYPE_NORMAL/**< Normal radio timeslot request. */
};
/**@brief SoC Events. */
enumNRF_SOC_EVTS
{
NRF_EVT_HFCLKSTARTED,/**< Event indicating that the HFCLK has started. */
NRF_EVT_POWER_FAILURE_WARNING,/**< Event indicating that a power failure warning has occurred. */
NRF_EVT_FLASH_OPERATION_SUCCESS,/**< Event indicating that the ongoing flash operation has completed successfully. */
NRF_EVT_FLASH_OPERATION_ERROR,/**< Event indicating that the ongoing flash operation has timed out with an error. */
NRF_EVT_RADIO_BLOCKED,/**< Event indicating that a radio timeslot was blocked. */
NRF_EVT_RADIO_CANCELED,/**< Event indicating that a radio timeslot was canceled by SoftDevice. */
NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN,/**< Event indicating that a radio timeslot signal callback handler return was invalid. */
NRF_EVT_RADIO_SESSION_IDLE,/**< Event indicating that a radio timeslot session is idle. */
NRF_EVT_RADIO_SESSION_CLOSED,/**< Event indicating that a radio timeslot session is closed. */
NRF_EVT_POWER_USB_POWER_READY,/**< Event indicating that a USB 3.3 V supply is ready. */
NRF_EVT_POWER_USB_DETECTED,/**< Event indicating that voltage supply is detected on VBUS. */
NRF_EVT_POWER_USB_REMOVED,/**< Event indicating that voltage supply is removed from VBUS. */
NRF_EVT_NUMBER_OF_EVTS
};
/**@} */
/**@addtogroup NRF_SOC_STRUCTURES Structures
* @{ */
/**@brief Represents a mutex for use with the nrf_mutex functions.
* @note Accessing the value directly is not safe, use the mutex functions!
*/
typedefvolatileuint8_tnrf_mutex_t;
/**@brief Parameters for a request for a timeslot as early as possible. */
typedefstruct
{
uint8_thfclk;/**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */
uint8_tpriority;/**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */
uint32_tlength_us;/**< The radio timeslot length (in the range 100 to 100,000] microseconds). */
uint32_ttimeout_us;/**< Longest acceptable delay until the start of the requested timeslot (up to @ref NRF_RADIO_EARLIEST_TIMEOUT_MAX_US microseconds). */
}nrf_radio_request_earliest_t;
/**@brief Parameters for a normal radio timeslot request. */
typedefstruct
{
uint8_thfclk;/**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */
uint8_tpriority;/**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */
uint32_tdistance_us;/**< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds). */
uint32_tlength_us;/**< The radio timeslot length (in the range [100..100,000] microseconds). */
}nrf_radio_request_normal_t;
/**@brief Radio timeslot request parameters. */
typedefstruct
{
uint8_trequest_type;/**< Type of request, see @ref NRF_RADIO_REQUEST_TYPE. */
union
{
nrf_radio_request_earliest_tearliest;/**< Parameters for requesting a radio timeslot as early as possible. */
nrf_radio_request_normal_tnormal;/**< Parameters for requesting a normal radio timeslot. */
}params;/**< Parameter union. */
}nrf_radio_request_t;
/**@brief Return parameters of the radio timeslot signal callback. */
typedefstruct
{
uint8_tcallback_action;/**< The action requested by the application when returning from the signal callback, see @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION. */
union
{
struct
{
nrf_radio_request_t*p_next;/**< The request parameters for the next radio timeslot. */
}request;/**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END. */
struct
{
uint32_tlength_us;/**< Requested extension of the radio timeslot duration (microseconds) (for minimum time see @ref NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US). */
}extend;/**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND. */
}params;/**< Parameter union. */
}nrf_radio_signal_callback_return_param_t;
/**@brief The radio timeslot signal callback type.
*
* @note In case of invalid return parameters, the radio timeslot will automatically end
* immediately after returning from the signal callback and the
* @ref NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN event will be sent.
* @note The returned struct pointer must remain valid after the signal callback
* function returns. For instance, this means that it must not point to a stack variable.
*
* @param[in] signal_type Type of signal, see @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE.
*
* @return Pointer to structure containing action requested by the application.