nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
nrf_802154_callbacks_dispatcher.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NRF_802154_CALLBACKS_DISPATCHER_H__
8#define NRF_802154_CALLBACKS_DISPATCHER_H__
9
21#include <nrf_802154_const.h>
22#include <nrf_802154_types.h>
23#include <stdbool.h>
24#include <stdint.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <zephyr/sys/iterable_sections.h>
31
33#define NRF_802154_CALLBACKS_DISPATCHER_INDEX_NONE UINT32_MAX
34
37 uint8_t pan_id[PAN_ID_SIZE];
38 uint8_t short_address[SHORT_ADDRESS_SIZE];
39 uint8_t mac[EXTENDED_ADDRESS_SIZE];
40};
41
48 void (*init)(void);
49 void (*deinit)(void);
50 void (*received_timestamp_raw)(uint8_t *data, int8_t power, uint8_t lqi, uint64_t time);
51 void (*receive_failed)(nrf_802154_rx_error_t error, uint32_t id);
52 void (*tx_ack_started)(const uint8_t *data);
53 void (*transmitted_raw)(uint8_t *frame,
54 const nrf_802154_transmit_done_metadata_t *metadata);
55 void (*transmit_failed)(uint8_t *frame, nrf_802154_tx_error_t error,
56 const nrf_802154_transmit_done_metadata_t *metadata);
57 void (*energy_detected)(const nrf_802154_energy_detected_t *result);
58 void (*energy_detection_failed)(nrf_802154_ed_error_t error);
59 struct nrf_802154_radio_client_config *(*get_config)(void);
60#if defined(CONFIG_NRF_802154_SER_HOST)
61 void (*serialization_error)(const nrf_802154_ser_err_data_t *err);
62#endif
63};
64
68 const char *name;
74 uint8_t ext_address[EXTENDED_ADDRESS_SIZE];
76 uint16_t short_address;
78 uint8_t pan_id[PAN_ID_SIZE];
79};
80
82#define NRF_802154_CALLBACKS_DISPATCHER_NAME_STR(x) #x
83#define NRF_802154_CALLBACKS_DISPATCHER_NAME_STR_EXPAND(x) \
84 NRF_802154_CALLBACKS_DISPATCHER_NAME_STR(x)
85
95#define NRF_802154_CALLBACKS_DISPATCHER_REGISTER(_entry_name, _callbacks_var) \
96 static STRUCT_SECTION_ITERABLE(nrf_802154_cb_dispatch_entry, _entry_name) = { \
97 .name = NRF_802154_CALLBACKS_DISPATCHER_NAME_STR_EXPAND(_entry_name), \
98 .callbacks = &(_callbacks_var), \
99 .saved_configuration = false, \
100 .ext_address = {0}, \
101 .short_address = 0, \
102 .pan_id = {0}, \
103 }
104
115
116#ifdef __cplusplus
117}
118#endif
119
124#endif /* NRF_802154_CALLBACKS_DISPATCHER_H__ */
int nrf_802154_callbacks_dispatcher_switch(const char *name)
Switch the active IEEE 802.15.4 radio driver client.
void(* energy_detected)(const nrf_802154_energy_detected_t *result)
Definition nrf_802154_callbacks_dispatcher.h:57
void(* init)(void)
Definition nrf_802154_callbacks_dispatcher.h:48
void(* received_timestamp_raw)(uint8_t *data, int8_t power, uint8_t lqi, uint64_t time)
Definition nrf_802154_callbacks_dispatcher.h:50
void(* transmitted_raw)(uint8_t *frame, const nrf_802154_transmit_done_metadata_t *metadata)
Definition nrf_802154_callbacks_dispatcher.h:53
void(* receive_failed)(nrf_802154_rx_error_t error, uint32_t id)
Definition nrf_802154_callbacks_dispatcher.h:51
void(* transmit_failed)(uint8_t *frame, nrf_802154_tx_error_t error, const nrf_802154_transmit_done_metadata_t *metadata)
Definition nrf_802154_callbacks_dispatcher.h:55
void(* tx_ack_started)(const uint8_t *data)
Definition nrf_802154_callbacks_dispatcher.h:52
void(* energy_detection_failed)(nrf_802154_ed_error_t error)
Definition nrf_802154_callbacks_dispatcher.h:58
void(* deinit)(void)
Definition nrf_802154_callbacks_dispatcher.h:49
Callbacks for the nRF IEEE 802.15.4 radio driver.
Definition nrf_802154_callbacks_dispatcher.h:47
bool saved_configuration
Definition nrf_802154_callbacks_dispatcher.h:72
const char * name
Definition nrf_802154_callbacks_dispatcher.h:68
uint8_t pan_id[PAN_ID_SIZE]
Definition nrf_802154_callbacks_dispatcher.h:78
uint16_t short_address
Definition nrf_802154_callbacks_dispatcher.h:76
uint8_t ext_address[EXTENDED_ADDRESS_SIZE]
Definition nrf_802154_callbacks_dispatcher.h:74
const struct nrf_802154_callbacks * callbacks
Definition nrf_802154_callbacks_dispatcher.h:70
Static registration entry in the iterable linker section.
Definition nrf_802154_callbacks_dispatcher.h:66
uint8_t pan_id[PAN_ID_SIZE]
Definition nrf_802154_callbacks_dispatcher.h:37
uint8_t mac[EXTENDED_ADDRESS_SIZE]
Definition nrf_802154_callbacks_dispatcher.h:39
uint8_t short_address[SHORT_ADDRESS_SIZE]
Definition nrf_802154_callbacks_dispatcher.h:38
Radio addresses applied after a client switch.
Definition nrf_802154_callbacks_dispatcher.h:36