Embassy
nrf-softdevice-s140

Crates

git

Versions

default

Flavors

pub unsafe fn sd_radio_request(p_request: *const nrf_radio_request_t) -> u32
Expand description

@brief Requests a radio timeslot.

@note The request type is determined by p_request->request_type, and can be one of @ref NRF_RADIO_REQ_TYPE_EARLIEST and @ref NRF_RADIO_REQ_TYPE_NORMAL. The first request in a session must always be of type @ref NRF_RADIO_REQ_TYPE_EARLIEST. @note For a normal request (@ref NRF_RADIO_REQ_TYPE_NORMAL), the start time of a radio timeslot is specified by p_request->distance_us and is given relative to the start of the previous timeslot. @note A too small p_request->distance_us will lead to a @ref NRF_EVT_RADIO_BLOCKED event. @note Timeslots scheduled too close will lead to a @ref NRF_EVT_RADIO_BLOCKED event. @note See the SoftDevice Specification for more on radio timeslot scheduling, distances and lengths. @note If an opportunity for the first radio timeslot is not found before 100 ms after the call to this function, it is not scheduled, and instead a @ref NRF_EVT_RADIO_BLOCKED event is sent. The application may then try to schedule the first radio timeslot again. @note Successful requests will result in nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START). Unsuccessful requests will result in a @ref NRF_EVT_RADIO_BLOCKED event, see @ref NRF_SOC_EVTS. @note The jitter in the start time of the radio timeslots is +/- @ref NRF_RADIO_START_JITTER_US us. @note The nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) call has a latency relative to the specified radio timeslot start, but this does not affect the actual start time of the timeslot. @note NRF_TIMER0 is reset at the start of the radio timeslot, and is clocked at 1MHz from the high frequency (16 MHz) clock source. If p_request->hfclk_force_xtal is true, the high frequency clock is guaranteed to be clocked from the external crystal. @note The SoftDevice will neither access the NRF_RADIO peripheral nor the NRF_TIMER0 peripheral during the radio timeslot.

@param[in] p_request Pointer to the request parameters.

@retval ::NRF_ERROR_FORBIDDEN Either: - The session is not open. - The session is not IDLE. - This is the first request and its type is not @ref NRF_RADIO_REQ_TYPE_EARLIEST. - The request type was set to @ref NRF_RADIO_REQ_TYPE_NORMAL after a @ref NRF_RADIO_REQ_TYPE_EARLIEST request was blocked. @retval ::NRF_ERROR_INVALID_ADDR If the p_request pointer is invalid. @retval ::NRF_ERROR_INVALID_PARAM If the parameters of p_request are not valid. @retval ::NRF_SUCCESS Otherwise.