nrfxlib API 2.7.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 "nrf.h"
29#include "nrf_peripherals.h"
30#include "nrf_errno.h"
31
33#define MPSL_TIMESLOT_LENGTH_MIN_US (100UL)
34
36#define MPSL_TIMESLOT_LENGTH_MAX_US (100000UL)
37
40#define MPSL_TIMESLOT_DISTANCE_MAX_US (256000000UL - 1UL)
41
43#define MPSL_TIMESLOT_EARLIEST_TIMEOUT_MAX_US (256000000UL - 1UL)
44
46#if defined(GRTC_PRESENT)
47#define MPSL_TIMESLOT_START_JITTER_US (0UL)
48#else
49#define MPSL_TIMESLOT_START_JITTER_US (1UL)
50#endif
51
53#define MPSL_TIMESLOT_EXTENSION_TIME_MIN_US (200UL)
54
56#define MPSL_TIMESLOT_EXTENSION_PROCESSING_TIME_MAX_US (25UL)
57
59#define MPSL_TIMESLOT_EXTENSION_MARGIN_MIN_US (87UL)
60
62#define MPSL_TIMESLOT_CONTEXT_SIZE (48)
63
65#define MPSL_TIMESLOT_CONTEXT_COUNT_MAX (8)
66
69
72{
108};
109
119{
136};
137
140{
157};
158
161{
164};
165
168{
175};
176
178typedef struct
179{
180 uint8_t hfclk;
181 uint8_t priority;
182 uint32_t length_us;
184 uint32_t timeout_us;
188
190typedef struct
191{
192 uint8_t hfclk;
193 uint8_t priority;
194 uint32_t distance_us;
196 uint32_t length_us;
199
201typedef struct
202{
203 uint8_t request_type;
204 union
205 {
209 } params;
211
213typedef struct
214{
218 union
219 {
220 struct
221 {
223 } request;
225 struct
226 {
227 uint32_t length_us;
230 } extend;
232 } params;
234
235
249typedef mpsl_timeslot_signal_return_param_t * (*mpsl_timeslot_callback_t) (mpsl_timeslot_session_id_t session_id,
250 uint32_t signal);
251
269int32_t mpsl_timeslot_session_count_set(void* p_mem, uint8_t n_sessions);
270
291int32_t mpsl_timeslot_session_open(mpsl_timeslot_callback_t mpsl_timeslot_signal_callback,
292 mpsl_timeslot_session_id_t* p_session_id);
293
305
341
342#ifdef __cplusplus
343}
344#endif
345
346#endif /* MPSL_TIMESLOT_H__ */
347
MPSL_TIMESLOT_SIGNAL_ACTION
The actions requested by the signal callback.
Definition: mpsl_timeslot.h:119
@ MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND
Definition: mpsl_timeslot.h:121
@ MPSL_TIMESLOT_SIGNAL_ACTION_END
Definition: mpsl_timeslot.h:130
@ MPSL_TIMESLOT_SIGNAL_ACTION_NONE
Definition: mpsl_timeslot.h:120
@ MPSL_TIMESLOT_SIGNAL_ACTION_REQUEST
Definition: mpsl_timeslot.h:133
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:161
@ MPSL_TIMESLOT_PRIORITY_HIGH
Definition: mpsl_timeslot.h:162
@ MPSL_TIMESLOT_PRIORITY_NORMAL
Definition: mpsl_timeslot.h:163
MPSL_TIMESLOT_SIGNAL
The timeslot signal types.
Definition: mpsl_timeslot.h:72
@ MPSL_TIMESLOT_SIGNAL_TIMER0
Definition: mpsl_timeslot.h:76
@ MPSL_TIMESLOT_SIGNAL_EXTEND_SUCCEEDED
Definition: mpsl_timeslot.h:85
@ MPSL_TIMESLOT_SIGNAL_INVALID_RETURN
Definition: mpsl_timeslot.h:98
@ MPSL_TIMESLOT_SIGNAL_START
Definition: mpsl_timeslot.h:73
@ MPSL_TIMESLOT_SIGNAL_CANCELLED
Definition: mpsl_timeslot.h:92
@ MPSL_TIMESLOT_SIGNAL_BLOCKED
Definition: mpsl_timeslot.h:89
@ MPSL_TIMESLOT_SIGNAL_EXTEND_FAILED
Definition: mpsl_timeslot.h:82
@ MPSL_TIMESLOT_SIGNAL_SESSION_CLOSED
Definition: mpsl_timeslot.h:104
@ MPSL_TIMESLOT_SIGNAL_RADIO
Definition: mpsl_timeslot.h:79
@ MPSL_TIMESLOT_SIGNAL_SESSION_IDLE
Definition: mpsl_timeslot.h:95
@ MPSL_TIMESLOT_SIGNAL_OVERSTAYED
Definition: mpsl_timeslot.h:105
MPSL_TIMESLOT_REQUEST_TYPE
Timeslot request type.
Definition: mpsl_timeslot.h:168
@ MPSL_TIMESLOT_REQ_TYPE_NORMAL
Definition: mpsl_timeslot.h:174
@ MPSL_TIMESLOT_REQ_TYPE_EARLIEST
Definition: mpsl_timeslot.h:169
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:68
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:249
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:140
@ MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED
Definition: mpsl_timeslot.h:141
@ MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE
Definition: mpsl_timeslot.h:148
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:182
uint8_t hfclk
Definition: mpsl_timeslot.h:180
uint8_t priority
Definition: mpsl_timeslot.h:181
uint32_t timeout_us
Definition: mpsl_timeslot.h:184
Parameters for a request for a timeslot as early as possible.
Definition: mpsl_timeslot.h:179
uint8_t hfclk
Definition: mpsl_timeslot.h:192
uint8_t priority
Definition: mpsl_timeslot.h:193
uint32_t distance_us
Definition: mpsl_timeslot.h:194
uint32_t length_us
Definition: mpsl_timeslot.h:196
Parameters for a normal timeslot request.
Definition: mpsl_timeslot.h:191
uint8_t request_type
Definition: mpsl_timeslot.h:203
mpsl_timeslot_request_normal_t normal
Definition: mpsl_timeslot.h:208
mpsl_timeslot_request_earliest_t earliest
Definition: mpsl_timeslot.h:206
Timeslot request parameters.
Definition: mpsl_timeslot.h:202
uint32_t length_us
Definition: mpsl_timeslot.h:227
mpsl_timeslot_request_t * p_next
Definition: mpsl_timeslot.h:222
uint8_t callback_action
Definition: mpsl_timeslot.h:215
Return parameters of the timeslot signal callback.
Definition: mpsl_timeslot.h:214