nrfxlib API 2.8.99
Loading...
Searching...
No Matches
sdc.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
7
18#ifndef SDC_H__
19#define SDC_H__
20
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26
27#include <stdint.h>
28#include <stdbool.h>
29#include "nrf.h"
30#include "nrf_errno.h"
31
33#define SDC_DEFAULT_RESOURCE_CFG_TAG 0
34
36#define SDC_DEFAULT_ADV_COUNT 1
37
39#define SDC_DEFAULT_PERIODIC_ADV_COUNT 0
40
43#define SDC_DEFAULT_PERIODIC_SYNC_COUNT 0
44
46#define SDC_DEFAULT_PERIODIC_ADV_RSP_COUNT 0
47
49#define SDC_DEFAULT_PERIODIC_ADV_RSP_TX_BUFFER_COUNT 1
50
52#define SDC_DEFAULT_PERIODIC_ADV_RSP_MAX_TX_DATA 73
53
55#define SDC_DEFAULT_PERIODIC_ADV_RSP_RX_BUFFER_COUNT 0
56
58#define SDC_DEFAULT_PERIODIC_SYNC_RSP_TX_BUFFER_COUNT 1
59
61#define SDC_DEFAULT_PERIPHERAL_COUNT 1
62
64#define SDC_DEFAULT_CENTRAL_COUNT 1
65
67#define SDC_DEFAULT_TX_PACKET_SIZE 27
68
70#define SDC_DEFAULT_RX_PACKET_SIZE 27
71
76#define SDC_DEFAULT_TX_PACKET_COUNT 3
77
82#define SDC_DEFAULT_RX_PACKET_COUNT 2
83
85#define SDC_DEFAULT_FAL_SIZE 8
86
92#define SDC_DEFAULT_SCAN_BUFFER_COUNT 3
93
95#define SDC_DEFAULT_PERIODIC_SYNC_BUFFER_COUNT 2
96
98#define SDC_DEFAULT_ADV_BUF_SIZE 31
99
101#define SDC_DEFAULT_PERIODIC_ADV_LIST_SIZE 0
102
104#define SDC_DEFAULT_CIG_COUNT 0
105
107#define SDC_DEFAULT_CIS_COUNT 0
108
110#define SDC_DEFAULT_BIG_COUNT 0
111
113#define SDC_DEFAULT_BIS_SINK_COUNT 0
114
116#define SDC_DEFAULT_BIS_SOURCE_COUNT 0
117
119#define SDC_DEFAULT_ISO_RX_PDU_BUFFER_PER_STREAM_COUNT 0
120
122#define SDC_DEFAULT_ISO_RX_SDU_BUFFER_COUNT 0
123
125#define SDC_DEFAULT_ISO_RX_SDU_BUFFER_SIZE 251
126
128#define SDC_DEFAULT_ISO_TX_SDU_BUFFER_COUNT 0
129
131#define SDC_DEFAULT_ISO_TX_SDU_BUFFER_SIZE 247
132
134#define SDC_DEFAULT_ISO_TX_PDU_BUFFER_PER_STREAM_COUNT 0
135
137#define SDC_DEFAULT_CS_COUNT 0
138
140#define SDC_BUILD_REVISION_SIZE 20
141
154#define __MEM_MINIMAL_CENTRAL_LINK_SIZE 811
155#define __MEM_MINIMAL_PERIPHERAL_LINK_SIZE 915
156#define __MEM_TX_BUFFER_OVERHEAD_SIZE 14
157#define __MEM_RX_BUFFER_OVERHEAD_SIZE 14
158
159#define __MEM_ADDITIONAL_LINK_SIZE(tx_size, rx_size, tx_count, rx_count) \
160 ((tx_count) * ((tx_size) + __MEM_TX_BUFFER_OVERHEAD_SIZE) - \
161 (SDC_DEFAULT_TX_PACKET_SIZE + __MEM_TX_BUFFER_OVERHEAD_SIZE) + \
162 (rx_count) * ((rx_size) + __MEM_RX_BUFFER_OVERHEAD_SIZE) - \
163 (SDC_DEFAULT_RX_PACKET_SIZE + __MEM_RX_BUFFER_OVERHEAD_SIZE))
164
172#define SDC_MEM_PER_CENTRAL_LINK(tx_size, rx_size, tx_count, rx_count) \
173 (__MEM_MINIMAL_CENTRAL_LINK_SIZE + \
174 __MEM_ADDITIONAL_LINK_SIZE(tx_size, rx_size, tx_count, rx_count))
175
183#define SDC_MEM_PER_PERIPHERAL_LINK(tx_size, rx_size, tx_count, rx_count) \
184 (__MEM_MINIMAL_PERIPHERAL_LINK_SIZE + \
185 __MEM_ADDITIONAL_LINK_SIZE(tx_size, rx_size, tx_count, rx_count))
186
188#define SDC_MEM_CENTRAL_LINKS_SHARED 17
189
191#define SDC_MEM_PERIPHERAL_LINKS_SHARED 17
192
197#define SDC_MEM_LE_POWER_CONTROL(num_links) ((num_links) > 0 ? (13 + (num_links) * 115) : 0)
198
203#define SDC_MEM_SUBRATING(num_links) (11 + (num_links) * 19)
204
209#define SDC_MEM_SYNC_TRANSFER(num_links) ((num_links) > 0 ? (13 + (num_links) * 139) : 0)
210
212#define SDC_MEM_QOS_CHANNEL_SURVEY (40)
213
215#define SDC_MEM_SCAN(buffer_count) (345 + (buffer_count) * 98)
216
218#define SDC_MEM_SCAN_EXT(buffer_count) (345 + (buffer_count) * 320)
219
223#define SDC_MEM_INITIATOR (320)
224
226#define SDC_MEM_FAL(max_num_entries) ((max_num_entries) > 0 ? (4 + (max_num_entries) * 8) : 0)
227
229#define __MEM_PER_ADV_SET_LOW(max_adv_data) ((4912+(max_adv_data)*18)/10)
230#define __MEM_PER_ADV_SET_HIGH(max_adv_data) (679+(max_adv_data))
231#define __MEM_PER_PERIODIC_ADV_SET_LOW(max_adv_data) ((2658+(max_adv_data)*18)/10)
232#define __MEM_PER_PERIODIC_ADV_SET_HIGH(max_adv_data) (457+(max_adv_data))
233
238#define SDC_MEM_PER_ADV_SET(max_adv_data) ((max_adv_data<255)?\
239 (__MEM_PER_ADV_SET_LOW(max_adv_data)):\
240 (__MEM_PER_ADV_SET_HIGH(max_adv_data)))
241
248#define SDC_MEM_PER_PERIODIC_ADV_SET(max_adv_data) ((max_adv_data<255)?\
249 (__MEM_PER_PERIODIC_ADV_SET_LOW(max_adv_data)):\
250 (__MEM_PER_PERIODIC_ADV_SET_HIGH(max_adv_data)))
251
256#define SDC_MEM_PER_PERIODIC_SYNC(buffer_count) (218 + (buffer_count) * 279)
257
263#define SDC_MEM_PER_PERIODIC_SYNC_RSP(tx_buffer_count, rx_buffer_count) \
264 (639 + (tx_buffer_count - 1) * 254 + (rx_buffer_count) * 278)
265
270#define SDC_MEM_PERIODIC_ADV_LIST(list_size) ((list_size) * 8)
271
273#define __MEM_PER_PERIODIC_ADV_RSP_TX_BUFFER(max_tx_data_size) ((max_tx_data_size) + 5)
274#define __MEM_PER_PERIODIC_ADV_RSP_RX_BUFFER (282)
275#define __MEM_MINIMAL_PERIODIC_ADV_RSP_SET_SIZE_WITH_RX (465)
276#define __MEM_MINIMAL_PERIODIC_ADV_RSP_SET_SIZE_WITHOUT_RX (166)
277#define __MEM_FOR_PERIODIC_ADV_RSP_FAILURE_REPORTING (224)
278#define __MEM_PER_ISO_PDU_POOL(count) ((count) > 0 ? (16 + (count) * 288) : 0)
279#define __MEM_PER_ISO_TX_HCI_BUFFER(count) ((count) > 0 ? (12 + (count) * 300) : 0)
280
289#define SDC_MEM_PER_PERIODIC_ADV_RSP_SET(max_adv_data, tx_buffer_count, rx_buffer_count, max_tx_data_size, failure_reporting_enabled) \
290 (SDC_MEM_PER_PERIODIC_ADV_SET(max_adv_data) \
291 + ((rx_buffer_count) > 0 ? __MEM_MINIMAL_PERIODIC_ADV_RSP_SET_SIZE_WITH_RX : \
292 __MEM_MINIMAL_PERIODIC_ADV_RSP_SET_SIZE_WITHOUT_RX ) \
293 + (tx_buffer_count) * __MEM_PER_PERIODIC_ADV_RSP_TX_BUFFER(max_tx_data_size) \
294 + (rx_buffer_count) * __MEM_PER_PERIODIC_ADV_RSP_RX_BUFFER \
295 + ((failure_reporting_enabled) ? __MEM_FOR_PERIODIC_ADV_RSP_FAILURE_REPORTING : 0))
296
298#define SDC_MEM_PER_CIG(count) ((count) > 0 ? (13 + (count) * 123) : 0)
299
301#define SDC_MEM_PER_CIS(count) ((count) > 0 ? (13 + (count) * 548) : 0)
302
304#define SDC_MEM_PER_BIG(count) ((count) > 0 ? (13 + (count) * 284) : 0)
305
307#define SDC_MEM_PER_BIS(count) ((count) > 0 ? (13 + (count) * 268) : 0)
308
314#define SDC_MEM_ISO_RX_PDU_POOL_PER_STREAM_SIZE(rx_pdu_buffer_per_stream_count, cis_count, bis_sink_count) \
315 (__MEM_PER_ISO_PDU_POOL(rx_pdu_buffer_per_stream_count) * ((cis_count) + (bis_sink_count)))
316
320#define SDC_MEM_ISO_RX_SDU_POOL_SIZE(count, size) ((count) > 0 ? (8 + (count) * ((size) + 13)) : 0)
321
327#define SDC_MEM_ISO_TX_PDU_POOL_SIZE(tx_pdu_buffer_per_stream_count, cis_count, bis_source_count) \
328 ((tx_pdu_buffer_per_stream_count) > 0 ? \
329 __MEM_PER_ISO_PDU_POOL(tx_pdu_buffer_per_stream_count) * ((cis_count) + (bis_source_count)) : 0)
330
334#define SDC_MEM_ISO_TX_SDU_POOL_SIZE(count, size) ((count) > 0 ? (12 + (count) * ((size) + 49)) : 0)
335
340#define SDC_MEM_CS(count) ((count) > 0 ? (13 + (count) * 8907) : 0)
341
346#define SDC_MEM_CS_SETUP_PHASE_LINKS(count) ((count) > 0 ? (11 + (count)*315) : 0)
347
359typedef void (*sdc_fault_handler_t)(const char * file, const uint32_t line);
360
361
366typedef void (*sdc_callback_t)(void);
367
368
418
419
421typedef struct
422{
423 uint8_t count;
425
426
428typedef struct
429{
439
440
442typedef struct
443{
444 uint8_t count;
446
447
448typedef struct
449{
457 uint16_t max_adv_data;
459
460
483
484
530
531
666
667
682int32_t sdc_init(sdc_fault_handler_t fault_handler);
683
684
710int32_t sdc_cfg_set(uint8_t config_tag,
711 uint8_t config_type,
712 sdc_cfg_t const * p_resource_cfg);
713
714
732int32_t sdc_enable(sdc_callback_t callback,
733 uint8_t * p_mem);
734
735
743int32_t sdc_disable(void);
744
745
756int32_t sdc_build_revision_get(uint8_t * p_build_revision);
757
769int32_t sdc_support_adv(void);
770
784
799
815int32_t sdc_support_scan(void);
816
833
850
867
882
893
910
927
941
956
970
984
1000
1015
1033
1050
1064
1078
1092
1103
1114
1128
1142
1153
1164
1175
1186
1197
1208
1219
1230
1242
1252
1271int32_t sdc_default_tx_power_set(int8_t requested_power_level);
1272
1286
1300
1311
1325
1326#ifdef __cplusplus
1327}
1328#endif
1329
1332#endif /* SDC_H__ */
int32_t sdc_support_le_path_loss_monitoring(void)
Support LE Path Loss Monitoring.
int32_t sdc_support_peripheral(void)
Support Peripheral role.
int32_t sdc_support_le_conn_cte_rsp_peripheral(void)
Support LE Connection CTE response for peripheral role.
int32_t sdc_support_ext_adv(void)
Support extended advertising.
int32_t sdc_disable(void)
Disable the SoftDevice Controller.
int32_t sdc_iso_host_timestamps_ignore(bool ignore)
Configure the controller to ignore HCI ISO data timestamps from the host.
int32_t sdc_support_sca_central(void)
Support Sleep Clock Accuracy (SCA) Update procedure for central role.
int32_t sdc_support_connection_subrating_peripheral(void)
Support Connection Subrating for peripheral role.
void(* sdc_fault_handler_t)(const char *file, const uint32_t line)
Function prototype for the fault handler.
Definition sdc.h:359
int32_t sdc_support_periodic_adv_sync_transfer_sender_peripheral(void)
Support for sending periodic advertising sync transfers as peripheral role.
int32_t sdc_support_periodic_adv_sync_transfer_receiver_peripheral(void)
Support for receiving periodic advertising sync transfers as peripheral role.
int32_t sdc_support_channel_sounding(void)
Support LE Channel Sounding.
int32_t sdc_support_connection_subrating_central(void)
Support Connection Subrating for central role.
int32_t sdc_support_le_power_class_1(void)
Support LE Power Class 1.
int32_t sdc_support_le_conn_cte_rsp_central(void)
Support LE Connection CTE response for central role.
int32_t sdc_cfg_set(uint8_t config_tag, uint8_t config_type, sdc_cfg_t const *p_resource_cfg)
Change or add a SoftDevice Controller configuration.
int32_t sdc_support_cis_peripheral(void)
Support Connected Isochronous streams in the peripheral role.
int32_t sdc_support_periodic_adv_sync_transfer_sender_central(void)
Support for sending periodic advertising sync transfers as central role.
int32_t sdc_support_ext_scan(void)
Support scanning for extended advertising PDUs.
int32_t sdc_enable(sdc_callback_t callback, uint8_t *p_mem)
Enable the SoftDevice Controller.
int32_t sdc_support_scan(void)
Support Scanning state.
int32_t sdc_support_le_periodic_adv(void)
Support LE Periodic Advertising in the Advertising state.
int32_t sdc_support_le_power_control_peripheral(void)
Support LE Power Control for peripheral role.
int32_t sdc_support_cis_central(void)
Support Connected Isochronous streams in the central role.
int32_t sdc_support_le_periodic_sync_with_rsp(void)
Support LE Periodic Advertising with Responses in the Synchronization state.
int32_t sdc_support_bis_source(void)
Support Broadcast Isochronous streams as a source.
int32_t sdc_support_central(void)
Support Scanner, Initiator, and Central role.
int32_t sdc_support_dle_peripheral(void)
Support Data Length Extensions for a peripheral device.
int32_t sdc_support_le_power_control_central(void)
Support LE Power Control for central role.
int32_t sdc_support_adv(void)
Support Advertising State.
int32_t sdc_support_parallel_scanning_and_initiating(void)
Support for scanning and initiating at the same time.
int32_t sdc_support_le_periodic_adv_with_rsp(void)
Support LE Periodic Advertising with Responses in the Advertising state.
int32_t sdc_init(sdc_fault_handler_t fault_handler)
Initialize the SoftDevice Controller.
int32_t sdc_support_phy_update_central(void)
Support PHY Update Procedure for central role.
int32_t sdc_support_qos_channel_survey(void)
Support for Quality of Service (QoS) channel survey module.
int32_t sdc_build_revision_get(uint8_t *p_build_revision)
Obtain build revision string.
int32_t sdc_support_phy_update_peripheral(void)
Support LE Coded PHY for peripheral role.
void(* sdc_callback_t)(void)
Function prototype for the SoftDevice Controller callback.
Definition sdc.h:366
int32_t sdc_support_sca_peripheral(void)
Support Sleep Clock Accuracy (SCA) Update procedure for peripheral role.
int32_t sdc_support_bis_sink(void)
Support Broadcast Isochronous streams as a sink.
int32_t sdc_support_le_periodic_sync(void)
Support LE Periodic Advertising in the Synchronization state.
sdc_cfg_type
Definition sdc.h:370
@ SDC_CFG_TYPE_PERIPHERAL_COUNT
Definition sdc.h:376
@ SDC_CFG_TYPE_PERIODIC_ADV_COUNT
Definition sdc.h:388
@ SDC_CFG_TYPE_PERIODIC_ADV_RSP_COUNT
Definition sdc.h:396
@ SDC_CFG_TYPE_BIS_SINK_COUNT
Definition sdc.h:410
@ SDC_CFG_TYPE_CIS_COUNT
Definition sdc.h:406
@ SDC_CFG_TYPE_BIS_SOURCE_COUNT
Definition sdc.h:412
@ SDC_CFG_TYPE_BUFFER_CFG
Definition sdc.h:378
@ SDC_CFG_TYPE_PERIODIC_SYNC_COUNT
Definition sdc.h:390
@ SDC_CFG_TYPE_PERIODIC_ADV_RSP_BUFFER_CFG
Definition sdc.h:398
@ SDC_CFG_TYPE_ADV_BUFFER_CFG
Definition sdc.h:384
@ SDC_CFG_TYPE_ISO_BUFFER_CFG
Definition sdc.h:414
@ SDC_CFG_TYPE_ADV_COUNT
Definition sdc.h:380
@ SDC_CFG_TYPE_BIG_COUNT
Definition sdc.h:408
@ SDC_CFG_TYPE_CENTRAL_COUNT
Definition sdc.h:374
@ SDC_CFG_TYPE_PERIODIC_ADV_RSP_FAILURE_REPORTING_CFG
Definition sdc.h:400
@ SDC_CFG_TYPE_CS_COUNT
Definition sdc.h:416
@ SDC_CFG_TYPE_PERIODIC_SYNC_RSP_TX_BUFFER_CFG
Definition sdc.h:402
@ SDC_CFG_TYPE_PERIODIC_ADV_LIST_SIZE
Definition sdc.h:394
@ SDC_CFG_TYPE_CIG_COUNT
Definition sdc.h:404
@ SDC_CFG_TYPE_PERIODIC_SYNC_BUFFER_CFG
Definition sdc.h:392
@ SDC_CFG_TYPE_SCAN_BUFFER_CFG
Definition sdc.h:382
@ SDC_CFG_TYPE_FAL_SIZE
Definition sdc.h:386
@ SDC_CFG_TYPE_NONE
Definition sdc.h:372
int32_t sdc_support_ext_central(void)
Support Extended Scanner, Extended Initiator, and Central role.
int32_t sdc_support_dle_central(void)
Support Data Length Extensions for a central device.
int32_t sdc_support_channel_sounding_test(void)
Support Channel Sounding test command.
int32_t sdc_support_le_2m_phy(void)
Support LE 2M PHY.
int32_t sdc_support_le_coded_phy(void)
Support LE Coded PHY.
int32_t sdc_default_tx_power_set(int8_t requested_power_level)
Support for setting the default radio TX power level.
int32_t sdc_support_periodic_adv_sync_transfer_receiver_central(void)
Support for receiving periodic advertising sync transfers as central role.
uint16_t max_adv_data
Definition sdc.h:457
Definition sdc.h:449
uint8_t rx_packet_count
Definition sdc.h:436
uint8_t rx_packet_size
Definition sdc.h:432
uint8_t tx_packet_size
Definition sdc.h:430
uint8_t tx_packet_count
Definition sdc.h:434
Buffer configuration.
Definition sdc.h:429
uint8_t count
Definition sdc.h:444
Buffer count configuration.
Definition sdc.h:443
uint8_t tx_sdu_buffer_count
Definition sdc.h:491
uint16_t rx_sdu_buffer_size
Definition sdc.h:528
uint8_t tx_pdu_buffer_per_stream_count
Definition sdc.h:508
uint8_t rx_pdu_buffer_per_stream_count
Definition sdc.h:518
uint8_t rx_sdu_buffer_count
Definition sdc.h:523
uint16_t tx_sdu_buffer_size
Definition sdc.h:496
Definition sdc.h:486
uint8_t max_tx_data_size
Definition sdc.h:473
uint8_t tx_buffer_count
Definition sdc.h:468
uint8_t rx_buffer_count
Definition sdc.h:481
uint8_t count
Definition sdc.h:423
Role count.
Definition sdc.h:422
sdc_cfg_role_count_t cs_count
Definition sdc.h:664
sdc_cfg_role_count_t periodic_adv_count
Definition sdc.h:575
uint8_t periodic_adv_list_size
Definition sdc.h:605
sdc_cfg_role_count_t bis_source_count
Definition sdc.h:654
sdc_cfg_role_count_t cig_count
Definition sdc.h:634
sdc_cfg_role_count_t central_count
Definition sdc.h:538
sdc_cfg_role_count_t periodic_sync_count
Definition sdc.h:580
sdc_cfg_iso_buffer_cfg_t iso_buffer_cfg
Definition sdc.h:659
sdc_cfg_adv_buffer_cfg_t adv_buffer_cfg
Definition sdc.h:565
sdc_cfg_buffer_count_t scan_buffer_cfg
Definition sdc.h:561
sdc_cfg_buffer_count_t periodic_sync_buffer_cfg
Definition sdc.h:598
sdc_cfg_role_count_t cis_count
Definition sdc.h:639
uint8_t periodic_adv_rsp_failure_reporting_cfg
Definition sdc.h:621
sdc_cfg_role_count_t adv_count
Definition sdc.h:551
sdc_cfg_buffer_cfg_t buffer_cfg
Definition sdc.h:546
uint16_t fal_size
Definition sdc.h:570
sdc_cfg_buffer_count_t periodic_sync_rsp_tx_buffer_cfg
Definition sdc.h:629
sdc_cfg_role_count_t big_count
Definition sdc.h:644
sdc_cfg_role_count_t bis_sink_count
Definition sdc.h:649
sdc_cfg_periodic_adv_rsp_buffer_cfg_t periodic_adv_rsp_buffer_cfg
Definition sdc.h:614
sdc_cfg_role_count_t periodic_adv_rsp_count
Definition sdc.h:610
sdc_cfg_role_count_t peripheral_count
Definition sdc.h:542
SoftDevice Controller configuration.
Definition sdc.h:534