S115 SoftDevice for nRF54L15/nRF54L10/nRF54L05 API documentation 10.0.0
Loading...
Searching...
No Matches
nrf_sdm.h
1/*
2 * Copyright (c) Nordic Semiconductor ASA
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this
9 * list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form, except as embedded into a Nordic
12 * Semiconductor ASA integrated circuit in a product or a software update for
13 * such product, must reproduce the above copyright notice, this list of
14 * conditions and the following disclaimer in the documentation and/or other
15 * materials provided with the distribution.
16 *
17 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * 4. This software, with or without modification, must only be used with a
22 * Nordic Semiconductor ASA integrated circuit.
23 *
24 * 5. Any software provided in binary form under this license must not be reverse
25 * engineered, decompiled, modified and/or disassembled.
26 *
27 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
28 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
33 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
36 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */
38
47#ifndef NRF_SDM_H__
48#define NRF_SDM_H__
49
50#include <stdint.h>
51#include "nrf_svc.h"
52#include "nrf_error.h"
53#include "nrf_error_sdm.h"
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
63#define SD_MAJOR_VERSION (10)
64
66#define SD_MINOR_VERSION (0)
67
69#define SD_BUGFIX_VERSION (0)
70
72#define SD_VARIANT_ID 115
73
79#define SD_VERSION (SD_MAJOR_VERSION * 1000000 + SD_MINOR_VERSION * 1000 + SD_BUGFIX_VERSION)
80
82#define SDM_SVC_BASE 0x10
83
85#define SD_UNIQUE_STR_SIZE 20
86
88#define SDM_INFO_FIELD_INVALID (0)
89
92#define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000)
93
96#define SD_INFO_STRUCT_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET)
97
100#define SD_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x08)
101
104#define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C)
105
108#define SD_ID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x10)
109
112#define SD_VERSION_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x14)
113
117#define SD_UNIQUE_STR_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x18)
118
121#define SD_INFO_STRUCT_SIZE_GET(baseaddr) (*((uint8_t *) ((baseaddr) + SD_INFO_STRUCT_SIZE_OFFSET)))
122
125#define SD_SIZE_GET(baseaddr) (*((uint32_t *) ((baseaddr) + SD_SIZE_OFFSET)))
126
128#define SD_FLASH_SIZE 0x19400
129
131#define SD_FWID_GET(baseaddr) (*((uint16_t *) ((baseaddr) + SD_FWID_OFFSET)))
132
134#define SD_ID_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_ID_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \
135 ? (*((uint32_t *) ((baseaddr) + SD_ID_OFFSET))) : SDM_INFO_FIELD_INVALID)
136
138#define SD_VERSION_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_VERSION_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \
139 ? (*((uint32_t *) ((baseaddr) + SD_VERSION_OFFSET))) : SDM_INFO_FIELD_INVALID)
140
142#define SD_UNIQUE_STR_ADDR_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_UNIQUE_STR_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \
143 ? (((uint8_t *) ((baseaddr) + SD_UNIQUE_STR_OFFSET))) : SDM_INFO_FIELD_INVALID)
144
147#define NRF_FAULT_ID_SD_RANGE_START 0x00000000
148#define NRF_FAULT_ID_APP_RANGE_START 0x00001000
153#define NRF_FAULT_ID_SD_ASSERT (NRF_FAULT_ID_SD_RANGE_START + 1)
154#define NRF_FAULT_ID_APP_MEMACC (NRF_FAULT_ID_APP_RANGE_START + 1)
174
184#define NRF_CLOCK_LF_ACCURACY_250_PPM (0)
185#define NRF_CLOCK_LF_ACCURACY_500_PPM (1)
186#define NRF_CLOCK_LF_ACCURACY_150_PPM (2)
187#define NRF_CLOCK_LF_ACCURACY_100_PPM (3)
188#define NRF_CLOCK_LF_ACCURACY_75_PPM (4)
189#define NRF_CLOCK_LF_ACCURACY_50_PPM (5)
190#define NRF_CLOCK_LF_ACCURACY_30_PPM (6)
191#define NRF_CLOCK_LF_ACCURACY_20_PPM (7)
192#define NRF_CLOCK_LF_ACCURACY_10_PPM (8)
193#define NRF_CLOCK_LF_ACCURACY_5_PPM (9)
194#define NRF_CLOCK_LF_ACCURACY_2_PPM (10)
195#define NRF_CLOCK_LF_ACCURACY_1_PPM (11)
202#define NRF_CLOCK_LF_SRC_RC (0)
203#define NRF_CLOCK_LF_SRC_XTAL (1)
204#define NRF_CLOCK_LF_SRC_SYNTH (2)
214typedef struct
215{
216 uint8_t source;
217 uint8_t rc_ctiv;
223 uint8_t rc_temp_ctiv;
241 uint8_t accuracy;
243 uint16_t hfclk_latency;
245 uint8_t hfint_ctiv;
254
275typedef void (*nrf_fault_handler_t)(uint32_t id, uint32_t pc, uint32_t info);
276
311SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler));
312
313
328
335SVCALL(SD_SOFTDEVICE_IS_ENABLED, uint32_t, sd_softdevice_is_enabled(uint8_t * p_softdevice_enabled));
336
339#ifdef __cplusplus
340}
341#endif
342#endif // NRF_SDM_H__
343
#define SDM_SVC_BASE
SoftDevice Manager SVC Base number.
Definition nrf_sdm.h:82
NRF_SD_SVCS
nRF SoftDevice Manager API SVC numbers.
Definition nrf_sdm.h:168
@ SVC_SDM_LAST
Definition nrf_sdm.h:172
@ SD_SOFTDEVICE_IS_ENABLED
Definition nrf_sdm.h:171
@ SD_SOFTDEVICE_DISABLE
Definition nrf_sdm.h:170
@ SD_SOFTDEVICE_ENABLE
Definition nrf_sdm.h:169
uint32_t sd_softdevice_enable(nrf_clock_lf_cfg_t const *p_clock_lf_cfg, nrf_fault_handler_t fault_handler)
Enables the SoftDevice and by extension the protocol stack.
uint32_t sd_softdevice_disable(void)
Disables the SoftDevice and by extension the protocol stack.
uint32_t sd_softdevice_is_enabled(uint8_t *p_softdevice_enabled)
Check if the SoftDevice is enabled.
void(* nrf_fault_handler_t)(uint32_t id, uint32_t pc, uint32_t info)
Fault Handler type.
Definition nrf_sdm.h:275
uint8_t hfint_ctiv
Definition nrf_sdm.h:245
uint8_t rc_ctiv
Definition nrf_sdm.h:217
uint16_t hfclk_latency
Definition nrf_sdm.h:243
uint8_t accuracy
Definition nrf_sdm.h:241
uint8_t rc_temp_ctiv
Definition nrf_sdm.h:223
uint8_t source
Definition nrf_sdm.h:216
Type representing LFCLK oscillator source.
Definition nrf_sdm.h:215