nrfxlib API 0.1.0
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
32#define NRF_MODEM_MAX_SHMEM_SIZE (128 << 10) /* 128KiB */
33
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
82#define NRF_MODEM_CELLULAR_SHMEM_CTRL_SIZE 0x4e8
86#define NRF_MODEM_DECT_PHY_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#define NRF_MODEM_SHMEM_BOOTLOADER_SIZE 0x2018
126
131 uint32_t base;
132 uint32_t size;
133};
134
145#define NRF_MODEM_FAULT_UNDEFINED 0x001
147#define NRF_MODEM_FAULT_HW_WD_RESET 0x002
149#define NRF_MODEM_FAULT_HARDFAULT 0x003
151#define NRF_MODEM_FAULT_MEM_MANAGE 0x004
153#define NRF_MODEM_FAULT_BUS 0x005
155#define NRF_MODEM_FAULT_USAGE 0x006
157#define NRF_MODEM_FAULT_SECURE_RESET 0x007
159#define NRF_MODEM_FAULT_PANIC_DOUBLE 0x008
161#define NRF_MODEM_FAULT_PANIC_RESET_LOOP 0x009
163#define NRF_MODEM_FAULT_ASSERT 0x010
165#define NRF_MODEM_FAULT_PANIC 0x011
167#define NRF_MODEM_FAULT_FLASH_ERASE 0x012
169#define NRF_MODEM_FAULT_FLASH_WRITE 0x013
171#define NRF_MODEM_FAULT_POFWARN 0x014
173#define NRF_MODEM_FAULT_THWARN 0x015
174
175
178 uint32_t reason;
180};
181
185typedef void (*nrf_modem_fault_handler_t)(struct nrf_modem_fault_info *fault_info);
186
190typedef void (*nrf_modem_dfu_handler_t)(uint32_t dfu_result);
191
199 uint32_t ipc_irq_prio;
204};
205
211 uint32_t ipc_irq_prio;
214};
215
223
245int nrf_modem_init(const struct nrf_modem_init_params *init_params);
246
269
277
291
292#ifdef __cplusplus
293}
294#endif
295
296#endif /* NRF_MODEM_H__ */
void(* nrf_modem_fault_handler_t)(struct nrf_modem_fault_info *fault_info)
Modem fault handler.
Definition: nrf_modem.h:185
void(* nrf_modem_dfu_handler_t)(uint32_t dfu_result)
Modem DFU handler.
Definition: nrf_modem.h:190
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:209
nrf_modem_fault_handler_t fault_handler
Definition: nrf_modem.h:213
uint32_t ipc_irq_prio
Definition: nrf_modem.h:211
Modem library bootloader initialization parameters.
Definition: nrf_modem.h:207
uint32_t size
Definition: nrf_modem.h:132
uint32_t base
Definition: nrf_modem.h:131
Shared memory configuration in bootloader mode. The base address must be word-aligned (4 bytes).
Definition: nrf_modem.h:130
uint32_t reason
Definition: nrf_modem.h:178
uint32_t program_counter
Definition: nrf_modem.h:179
Modem fault info struct.
Definition: nrf_modem.h:177
struct nrf_modem_shmem_cfg shmem
Definition: nrf_modem.h:197
uint32_t ipc_irq_prio
Definition: nrf_modem.h:199
nrf_modem_dfu_handler_t dfu_handler
Definition: nrf_modem.h:203
nrf_modem_fault_handler_t fault_handler
Definition: nrf_modem.h:201
Modem library initialization parameters.
Definition: nrf_modem.h:195
struct nrf_modem_shmem_cfg::@24 tx
uint32_t size
Definition: nrf_modem.h:96
struct nrf_modem_shmem_cfg::@25 rx
struct nrf_modem_shmem_cfg::@26 trace
uint32_t base
Definition: nrf_modem.h:95
struct nrf_modem_shmem_cfg::@23 ctrl
Shared memory configuration in normal operation mode.
Definition: nrf_modem.h:89