nrfxlib API 3.3.99
Loading...
Searching...
No Matches
mpsl_timeslot.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
20#ifndef MPSL_TIMESLOT_H__
21#define MPSL_TIMESLOT_H__
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <stdint.h>
28#include "nrfx.h"
29#include "nrf_errno.h"
30
32#define MPSL_TIMESLOT_LENGTH_MIN_US (100UL)
33
35#define MPSL_TIMESLOT_LENGTH_MAX_US (100000UL)
36
39#define MPSL_TIMESLOT_DISTANCE_MAX_US (256000000UL - 1UL)
40
42#define MPSL_TIMESLOT_EARLIEST_TIMEOUT_MAX_US (256000000UL - 1UL)
43
45#if defined(GRTC_PRESENT)
46#define MPSL_TIMESLOT_START_JITTER_US (0UL)
47#else
48#define MPSL_TIMESLOT_START_JITTER_US (1UL)
49#endif
50
52#define MPSL_TIMESLOT_EXTENSION_TIME_MIN_US (200UL)
53
55#define MPSL_TIMESLOT_EXTENSION_PROCESSING_TIME_MAX_US (25UL)
56
58#define MPSL_TIMESLOT_EXTENSION_MARGIN_MIN_US (87UL)
59
61#define MPSL_TIMESLOT_CONTEXT_SIZE (96U)
62
64#define MPSL_TIMESLOT_CONTEXT_COUNT_MAX (8)
65
68
110
138
161
168
182
184typedef struct
185{
186 uint8_t hfclk;
187 uint8_t priority;
188 uint32_t length_us;
190 uint32_t timeout_us;
194
196typedef struct
197{
198 uint8_t hfclk;
199 uint8_t priority;
200 uint32_t distance_us;
202 uint32_t length_us;
205
217
219typedef struct
220{
224 union
225 {
226 struct
227 {
229 } request;
231 struct
232 {
233 uint32_t length_us;
236 } extend;
238 } params;
240
241
258typedef mpsl_timeslot_signal_return_param_t * (*mpsl_timeslot_callback_t) (mpsl_timeslot_session_id_t session_id,
259 uint32_t signal);
260
278int32_t mpsl_timeslot_session_count_set(void* p_mem, uint8_t n_sessions);
279
300int32_t mpsl_timeslot_session_open(mpsl_timeslot_callback_t mpsl_timeslot_signal_callback,
301 mpsl_timeslot_session_id_t* p_session_id);
302
314
350
351#ifdef __cplusplus
352}
353#endif
354
355#endif /* MPSL_TIMESLOT_H__ */
356
MPSL_TIMESLOT_SIGNAL_ACTION
The actions requested by the signal callback.
Definition mpsl_timeslot.h:120
@ MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND
Definition mpsl_timeslot.h:122
@ MPSL_TIMESLOT_SIGNAL_ACTION_END
Definition mpsl_timeslot.h:131
@ MPSL_TIMESLOT_SIGNAL_ACTION_NONE
Definition mpsl_timeslot.h:121
@ MPSL_TIMESLOT_SIGNAL_ACTION_REQUEST
Definition mpsl_timeslot.h:134
int32_t mpsl_timeslot_session_count_set(void *p_mem, uint8_t n_sessions)
Set or update the MPSL timeslot configuration.
MPSL_TIMESLOT_PRIORITY
Timeslot event priorities.
Definition mpsl_timeslot.h:164
@ MPSL_TIMESLOT_PRIORITY_HIGH
Definition mpsl_timeslot.h:165
@ MPSL_TIMESLOT_PRIORITY_NORMAL
Definition mpsl_timeslot.h:166
MPSL_TIMESLOT_SIGNAL
The timeslot signal types.
Definition mpsl_timeslot.h:71
@ MPSL_TIMESLOT_SIGNAL_TIMER0
Definition mpsl_timeslot.h:75
@ MPSL_TIMESLOT_SIGNAL_EXTEND_SUCCEEDED
Definition mpsl_timeslot.h:86
@ MPSL_TIMESLOT_SIGNAL_INVALID_RETURN
Definition mpsl_timeslot.h:99
@ MPSL_TIMESLOT_SIGNAL_START
Definition mpsl_timeslot.h:72
@ MPSL_TIMESLOT_SIGNAL_CANCELLED
Definition mpsl_timeslot.h:93
@ MPSL_TIMESLOT_SIGNAL_BLOCKED
Definition mpsl_timeslot.h:90
@ MPSL_TIMESLOT_SIGNAL_EXTEND_FAILED
Definition mpsl_timeslot.h:83
@ MPSL_TIMESLOT_SIGNAL_SESSION_CLOSED
Definition mpsl_timeslot.h:105
@ MPSL_TIMESLOT_SIGNAL_RADIO
Definition mpsl_timeslot.h:80
@ MPSL_TIMESLOT_SIGNAL_SESSION_IDLE
Definition mpsl_timeslot.h:96
@ MPSL_TIMESLOT_SIGNAL_OVERSTAYED
Definition mpsl_timeslot.h:106
MPSL_TIMESLOT_REQUEST_TYPE
Timeslot request type.
Definition mpsl_timeslot.h:171
@ MPSL_TIMESLOT_REQ_TYPE_NORMAL
Definition mpsl_timeslot.h:177
@ MPSL_TIMESLOT_REQ_TYPE_EARLIEST
Definition mpsl_timeslot.h:172
int32_t mpsl_timeslot_session_open(mpsl_timeslot_callback_t mpsl_timeslot_signal_callback, mpsl_timeslot_session_id_t *p_session_id)
Opens a session for timeslot requests.
uint8_t mpsl_timeslot_session_id_t
The timeslot session id type.
Definition mpsl_timeslot.h:67
mpsl_timeslot_signal_return_param_t *(* mpsl_timeslot_callback_t)(mpsl_timeslot_session_id_t session_id, uint32_t signal)
The timeslot signal callback type.
Definition mpsl_timeslot.h:258
int32_t mpsl_timeslot_request(mpsl_timeslot_session_id_t session_id, mpsl_timeslot_request_t const *p_request)
Requests a timeslot.
MPSL_TIMESLOT_HFCLK_CFG
Timeslot high frequency clock source configuration.
Definition mpsl_timeslot.h:141
@ MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED
Definition mpsl_timeslot.h:142
@ MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE
Definition mpsl_timeslot.h:149
int32_t mpsl_timeslot_session_close(mpsl_timeslot_session_id_t session_id)
Closes a session for timeslot requests.
uint32_t length_us
Definition mpsl_timeslot.h:188
uint8_t hfclk
Definition mpsl_timeslot.h:186
uint8_t priority
Definition mpsl_timeslot.h:187
uint32_t timeout_us
Definition mpsl_timeslot.h:190
Parameters for a request for a timeslot as early as possible.
Definition mpsl_timeslot.h:185
uint8_t hfclk
Definition mpsl_timeslot.h:198
uint8_t priority
Definition mpsl_timeslot.h:199
uint32_t distance_us
Definition mpsl_timeslot.h:200
uint32_t length_us
Definition mpsl_timeslot.h:202
Parameters for a normal timeslot request.
Definition mpsl_timeslot.h:197
uint8_t request_type
Definition mpsl_timeslot.h:209
mpsl_timeslot_request_normal_t normal
Definition mpsl_timeslot.h:214
mpsl_timeslot_request_earliest_t earliest
Definition mpsl_timeslot.h:212
Timeslot request parameters.
Definition mpsl_timeslot.h:208
uint32_t length_us
Definition mpsl_timeslot.h:233
mpsl_timeslot_request_t * p_next
Definition mpsl_timeslot.h:228
uint8_t callback_action
Definition mpsl_timeslot.h:221
Return parameters of the timeslot signal callback.
Definition mpsl_timeslot.h:220