nrfxlib API 3.3.99
Loading...
Searching...
No Matches
nrf_802154_core.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017, Nordic Semiconductor ASA
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other 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 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
34
40#ifndef NRF_802154_CORE_H_
41#define NRF_802154_CORE_H_
42
43#include <stdbool.h>
44#include <stdint.h>
45
46#include "nrf_802154_config.h"
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
58typedef enum
59{
60 /* Sleep */
64 /* Receive */
68 /* Transmit */
73 /* Energy Detection */
76 /* CCA */
79#if NRF_802154_CARRIER_FUNCTIONS_ENABLED
80
81 /* Continuous carrier */
84 /* Modulated carrier */
87#endif /* NRF_802154_CARRIER_FUNCTIONS_ENABLED */
88
90
95
100
107
108/***************************************************************************************************
109 * @section State machine transition requests
110 **************************************************************************************************/
111
121
122#if NRF_802154_CSMA_CA_CANCEL_ENABLED || defined(__DOXYGEN__)
123
137
138#endif /* NRF_802154_CSMA_CA_CANCEL_ENABLED */
139
153 req_originator_t req_orig,
154 nrf_802154_notification_func_t notify_function,
155 bool notify_abort,
156 uint32_t id);
157
170 req_originator_t req_orig,
172
182
197
209
210#if NRF_802154_CARRIER_FUNCTIONS_ENABLED
211
222
234 const uint8_t * p_data);
235
236#endif /* NRF_802154_CARRIER_FUNCTIONS_ENABLED */
237
238/***************************************************************************************************
239 * @section State machine notifications
240 **************************************************************************************************/
241
252
264
270
275
282
291
300
305
306#if !NRF_802154_INTERNAL_IRQ_HANDLING
307
312
313#endif /* !NRF_802154_INTERNAL_IRQ_HANDLING */
314
315#ifdef __cplusplus
316}
317#endif
318
319#endif /* NRF_802154_CORE_H_ */
void(* nrf_802154_notification_func_t)(bool result)
Function type used for notifications from critical sections in the core module.
Definition nrf_802154_notification.h:63
uint8_t nrf_802154_term_t
Termination level selected for a particular request.
Definition nrf_802154_types.h:162
uint8_t nrf_802154_tx_error_t
Errors reported during the frame transmission.
Definition nrf_802154_types.h:88
req_originator_t
Definition nrf_802154_const.h:235
nrf_802154_tx_error_t nrf_802154_core_transmit(nrf_802154_term_t term_lvl, req_originator_t req_orig, nrf_802154_transmit_params_t *p_params)
Request the transition to the RADIO_STATE_TX state.
void nrf_802154_core_irq_handler(void)
Notify the core module that there is a pending IRQ to be handled.
uint8_t nrf_802154_core_last_frame_lqi_get(void)
Get LQI of the last received non-ACK frame.
bool nrf_802154_core_rssi_measure(void)
Notify the core module that the next higher layer requested the RSSI measurement.
bool nrf_802154_core_channel_update(req_originator_t req_orig)
Notify the core module that the next higher layer requested the change of the channel.
bool nrf_802154_core_receive(nrf_802154_term_t term_lvl, req_originator_t req_orig, nrf_802154_notification_func_t notify_function, bool notify_abort, uint32_t id)
Request the transition to the RADIO_STATE_RX state.
bool nrf_802154_core_continuous_carrier(nrf_802154_term_t term_lvl)
Request the transition to the RADIO_STATE_CONTINUOUS_CARRIER state.
bool nrf_802154_core_sleep_with_cancel_csma_ca(nrf_802154_term_t term_lvl)
Request the transition to the RADIO_STATE_SLEEP state with the CSMA-CA procedure cancelled.
void nrf_802154_core_init(void)
Initialize the 802.15.4 driver core.
radio_state_t
Module that contains core of the nRF IEEE 802.15.4 radio driver.
Definition nrf_802154_core.h:59
@ RADIO_STATE_CCA
Definition nrf_802154_core.h:77
@ RADIO_STATE_MODULATED_CARRIER
Definition nrf_802154_core.h:85
@ RADIO_STATE_CONTINUOUS_CARRIER
Definition nrf_802154_core.h:82
@ RADIO_STATE_TX_ACK
Definition nrf_802154_core.h:66
@ RADIO_STATE_RX_ACK
Definition nrf_802154_core.h:71
@ RADIO_STATE_RX
Definition nrf_802154_core.h:65
@ RADIO_STATE_SLEEP
Definition nrf_802154_core.h:61
@ RADIO_STATE_ED
Definition nrf_802154_core.h:74
@ RADIO_STATE_TX
Definition nrf_802154_core.h:70
@ RADIO_STATE_FALLING_ASLEEP
Definition nrf_802154_core.h:62
@ RADIO_STATE_CCA_TX
Definition nrf_802154_core.h:69
void nrf_802154_core_deinit(void)
Deinitialize the 802.15.4 driver core.
bool nrf_802154_core_cca_cfg_update(void)
Notify the core module that the next higher layer requested the change of the CCA configuration.
radio_state_t nrf_802154_core_state_get(void)
Get the current state of the nRF 802.15.4 driver.
bool nrf_802154_core_modulated_carrier(nrf_802154_term_t term_lvl, const uint8_t *p_data)
Request the transition to the RADIO_STATE_MODULATED_CARRIER state.
bool nrf_802154_core_notify_buffer_free(uint8_t *p_data)
Notify the core module that a higher layer freed a frame buffer.
bool nrf_802154_core_last_rssi_measurement_get(int8_t *p_rssi)
Get the last RSSI measurement.
bool nrf_802154_core_ack_timeout_handle(const nrf_802154_ack_timeout_handle_params_t *p_param)
Request end of waiting for an ACK by the core.
bool nrf_802154_core_antenna_update(void)
Notify the core module that the next higher layer requested the change of the antenna.
bool nrf_802154_core_energy_detection(nrf_802154_term_t term_lvl, uint32_t time_us)
Request the transition to the RADIO_STATE_ED state.
bool nrf_802154_core_sleep(nrf_802154_term_t term_lvl)
Request the transition to the RADIO_STATE_SLEEP state.
bool nrf_802154_core_cca(nrf_802154_term_t term_lvl)
Request the transition to the RADIO_STATE_CCA state.
int8_t nrf_802154_core_last_frame_rssi_get(void)
Get RSSI of the last received non-ACK frame.
Definition nrf_802154_types_internal.h:136
Definition nrf_802154_types_internal.h:121