nrfxlib API 2.8.0
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
109
137
160
167
178
180typedef struct
181{
182 uint8_t hfclk;
183 uint8_t priority;
184 uint32_t length_us;
186 uint32_t timeout_us;
190
192typedef struct
193{
194 uint8_t hfclk;
195 uint8_t priority;
196 uint32_t distance_us;
198 uint32_t length_us;
201
213
215typedef struct
216{
220 union
221 {
222 struct
223 {
225 } request;
227 struct
228 {
229 uint32_t length_us;
232 } extend;
234 } params;
236
237
251typedef mpsl_timeslot_signal_return_param_t * (*mpsl_timeslot_callback_t) (mpsl_timeslot_session_id_t session_id,
252 uint32_t signal);
253
271int32_t mpsl_timeslot_session_count_set(void* p_mem, uint8_t n_sessions);
272
293int32_t mpsl_timeslot_session_open(mpsl_timeslot_callback_t mpsl_timeslot_signal_callback,
294 mpsl_timeslot_session_id_t* p_session_id);
295
307
343
344#ifdef __cplusplus
345}
346#endif
347
348#endif /* MPSL_TIMESLOT_H__ */
349
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:163
@ MPSL_TIMESLOT_PRIORITY_HIGH
Definition mpsl_timeslot.h:164
@ MPSL_TIMESLOT_PRIORITY_NORMAL
Definition mpsl_timeslot.h:165
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:170
@ MPSL_TIMESLOT_REQ_TYPE_NORMAL
Definition mpsl_timeslot.h:176
@ MPSL_TIMESLOT_REQ_TYPE_EARLIEST
Definition mpsl_timeslot.h:171
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:251
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:184
uint8_t hfclk
Definition mpsl_timeslot.h:182
uint8_t priority
Definition mpsl_timeslot.h:183
uint32_t timeout_us
Definition mpsl_timeslot.h:186
Parameters for a request for a timeslot as early as possible.
Definition mpsl_timeslot.h:181
uint8_t hfclk
Definition mpsl_timeslot.h:194
uint8_t priority
Definition mpsl_timeslot.h:195
uint32_t distance_us
Definition mpsl_timeslot.h:196
uint32_t length_us
Definition mpsl_timeslot.h:198
Parameters for a normal timeslot request.
Definition mpsl_timeslot.h:193
uint8_t request_type
Definition mpsl_timeslot.h:205
mpsl_timeslot_request_normal_t normal
Definition mpsl_timeslot.h:210
mpsl_timeslot_request_earliest_t earliest
Definition mpsl_timeslot.h:208
Timeslot request parameters.
Definition mpsl_timeslot.h:204
uint32_t length_us
Definition mpsl_timeslot.h:229
mpsl_timeslot_request_t * p_next
Definition mpsl_timeslot.h:224
uint8_t callback_action
Definition mpsl_timeslot.h:217
Return parameters of the timeslot signal callback.
Definition mpsl_timeslot.h:216