nrfxlib API 3.4.99
Loading...
Searching...
No Matches
nrf_modem.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017-2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef NRF_MODEM_H__
15#define NRF_MODEM_H__
16
17#include <stdbool.h>
18#include <stdint.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
30
32#define NRF_MODEM_MAX_SHMEM_SIZE (128 << 10) /* 128KiB */
33
35
43
47#define NRF_MODEM_DFU_RESULT_OK 0x5500001u
51#define NRF_MODEM_DFU_RESULT_INTERNAL_ERROR 0x4400001u
55#define NRF_MODEM_DFU_RESULT_HARDWARE_ERROR 0x4400002u
59#define NRF_MODEM_DFU_RESULT_AUTH_ERROR 0x4400003u
63#define NRF_MODEM_DFU_RESULT_UUID_ERROR 0x4400004u
67#define NRF_MODEM_DFU_RESULT_VOLTAGE_LOW 0x4400005u
68
70
78
82#define NRF_MODEM_CELLULAR_SHMEM_CTRL_SIZE 0x4e8
86#define NRF_MODEM_DECT_SHMEM_CTRL_SIZE 0x728
87
94 struct {
95 uint32_t base;
96 uint32_t size;
101 struct {
102 uint32_t base;
103 uint32_t size;
104 } tx;
108 struct {
109 uint32_t base;
110 uint32_t size;
111 } rx;
115 struct {
116 uint32_t base;
117 uint32_t size;
119};
120
125#if defined(CONFIG_SOC_SERIES_NRF91)
126#define NRF_MODEM_SHMEM_BOOTLOADER_SIZE 0x2018
127#elif defined(CONFIG_SOC_SERIES_NRF92)
128#define NRF_MODEM_SHMEM_BOOTLOADER_SIZE 0x481C
129#endif
130
135 uint32_t base;
136 uint32_t size;
137};
138
140
147
149#define NRF_MODEM_FAULT_UNDEFINED 0x001
151#define NRF_MODEM_FAULT_HW_WD_RESET 0x002
153#define NRF_MODEM_FAULT_HARDFAULT 0x003
155#define NRF_MODEM_FAULT_MEM_MANAGE 0x004
157#define NRF_MODEM_FAULT_BUS 0x005
159#define NRF_MODEM_FAULT_USAGE 0x006
161#define NRF_MODEM_FAULT_SECURE_RESET 0x007
163#define NRF_MODEM_FAULT_PANIC_DOUBLE 0x008
165#define NRF_MODEM_FAULT_PANIC_RESET_LOOP 0x009
167#define NRF_MODEM_FAULT_ASSERT 0x010
169#define NRF_MODEM_FAULT_PANIC 0x011
171#define NRF_MODEM_FAULT_FLASH_ERASE 0x012
173#define NRF_MODEM_FAULT_FLASH_WRITE 0x013
175#define NRF_MODEM_FAULT_POFWARN 0x014
177#define NRF_MODEM_FAULT_THWARN 0x015
178
179
182 uint32_t reason;
184};
185
189typedef void (*nrf_modem_fault_handler_t)(struct nrf_modem_fault_info *fault_info);
190
194typedef void (*nrf_modem_dfu_handler_t)(uint32_t dfu_result);
195
197
209
219
227
249int nrf_modem_init(const struct nrf_modem_init_params *init_params);
250
272
280
294
295#ifdef __cplusplus
296}
297#endif
298
299#endif /* NRF_MODEM_H__ */
void(* nrf_modem_fault_handler_t)(struct nrf_modem_fault_info *fault_info)
Modem fault handler.
Definition nrf_modem.h:189
void(* nrf_modem_dfu_handler_t)(uint32_t dfu_result)
Modem DFU handler.
Definition nrf_modem.h:194
int nrf_modem_init(const struct nrf_modem_init_params *init_params)
Initialize the Modem library and turn on the modem.
bool nrf_modem_is_initialized(void)
Check whether the modem is initialized.
int nrf_modem_shutdown(void)
De-initialize the Modem library and turn off the modem.
char * nrf_modem_build_version(void)
Return a statically allocated string identifying the Modem library build.
int nrf_modem_bootloader_init(const struct nrf_modem_bootloader_init_params *init_params)
Initialize the Modem library and turn on the modem in bootloader mode.
struct nrf_modem_bootloader_shmem_cfg shmem
Definition nrf_modem.h:213
nrf_modem_fault_handler_t fault_handler
Definition nrf_modem.h:217
uint32_t ipc_irq_prio
Definition nrf_modem.h:215
Modem library bootloader initialization parameters.
Definition nrf_modem.h:211
uint32_t size
Definition nrf_modem.h:136
uint32_t base
Definition nrf_modem.h:135
Bootloader shared memory size.
Definition nrf_modem.h:134
uint32_t reason
Definition nrf_modem.h:182
uint32_t program_counter
Definition nrf_modem.h:183
Modem fault info struct.
Definition nrf_modem.h:181
struct nrf_modem_shmem_cfg shmem
Definition nrf_modem.h:201
uint32_t ipc_irq_prio
Definition nrf_modem.h:203
nrf_modem_dfu_handler_t dfu_handler
Definition nrf_modem.h:207
nrf_modem_fault_handler_t fault_handler
Definition nrf_modem.h:205
Modem library initialization parameters.
Definition nrf_modem.h:199
struct nrf_modem_shmem_cfg::@140253121374023137366311212137146104047045141175 ctrl
struct nrf_modem_shmem_cfg::@222256237053103043123302126352035177345326263140 rx
struct nrf_modem_shmem_cfg::@236116110046007121202141200237120114270077173177 tx
struct nrf_modem_shmem_cfg::@102256137357354232363156047056312365237351104215 trace
uint32_t size
Definition nrf_modem.h:96
uint32_t base
Definition nrf_modem.h:95
Shared memory configuration in normal operation mode.
Definition nrf_modem.h:89