nrfxlib API 2.7.99
Loading...
Searching...
No Matches
nrf_802154_trx.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019, 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
42#ifndef NRF_802154_TRX_H_
43#define NRF_802154_TRX_H_
44
45#include <stdbool.h>
46#include <stdint.h>
47
48#include "nrf_802154_config.h"
49#include "nrf_802154_sl_types.h"
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
57typedef enum
58{
63
64 /* PPIS disabled deconfigured
65 * RADIO is DISABLED, RXDISABLE
66 * RADIO shorts are 0
67 * TIMER is running
68 * FEM is going to powered or is powered depending if RADIO reached DISABLED
69 */
71
79
80 /* PPIS disabled deconfigured
81 * RADIO is DISABLED, TXDISABLE, RXDISABLE
82 * RADIO shorts are 0
83 * TIMER is stopped
84 * FEM is going to powered or is powered depending if RADIO reached DISABLED
85 */
88
90typedef enum
91{
95
97typedef enum
98{
101
104
108
110typedef enum
111{
114
117
121
129
148
164
172
177void nrf_802154_trx_channel_set(uint8_t channel);
178
181
213 const nrf_802154_fal_tx_power_split_t * p_ack_tx_power);
214
226
235
243
250
256
267
291
304bool nrf_802154_trx_receive_buffer_set(void * p_receive_buffer);
305
356void nrf_802154_trx_transmit_frame(const void * p_transmit_buffer,
358 uint8_t cca_attempts,
359 const nrf_802154_fal_tx_power_split_t * p_tx_power,
360 nrf_802154_trx_transmit_notifications_t notifications_mask);
361
380bool nrf_802154_trx_transmit_ack(const void * p_transmit_buffer, uint32_t delay_us);
381
390
396
397#if NRF_802154_CARRIER_FUNCTIONS_ENABLED
398
406void nrf_802154_trx_continuous_carrier(const nrf_802154_fal_tx_power_split_t * p_tx_power);
407
416void nrf_802154_trx_continuous_carrier_restart(void);
417
423void nrf_802154_trx_modulated_carrier(const void * p_transmit_buffer,
424 const nrf_802154_fal_tx_power_split_t * p_tx_power);
425
427void nrf_802154_trx_modulated_carrier_restart(void);
428
429#endif // NRF_802154_CARRIER_FUNCTIONS_ENABLED
430
441void nrf_802154_trx_energy_detection(uint32_t ed_count);
442
451
456
461
468
493
509
524extern uint8_t nrf_802154_trx_receive_frame_bcmatched(uint8_t bcc);
525
546
570
590
609
622
637
656
671
689
704
722
741
761extern void nrf_802154_trx_standalone_cca_finished(bool channel_was_idle);
762
781extern void nrf_802154_trx_energy_detection_finished(uint8_t ed_sample);
782
787const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_end_event_handle_get(void);
788
793const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_ready_event_handle_get(void);
794
799const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_crcok_event_handle_get(void);
800
805const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_phyend_event_handle_get(void);
806
807#ifdef __cplusplus
808}
809#endif
810
811#endif /* NRF_802154_TRX_H_ */
void nrf_802154_trx_receive_ack_started(void)
Handler called at the beginning of a ACK reception.
void nrf_802154_trx_init(void)
Initializes trx module.
void nrf_802154_trx_receive_ack_received(void)
Handler called when an ack is received with correct crc.
trx_state_t
Module that contains radio hardware-related functions of the nRF IEEE 802.15.4 radio driver.
Definition: nrf_802154_trx.h:58
@ TRX_STATE_MODULATED_CARRIER
Definition: nrf_802154_trx.h:77
@ TRX_STATE_TXACK
Definition: nrf_802154_trx.h:74
@ TRX_STATE_GOING_IDLE
Definition: nrf_802154_trx.h:61
@ TRX_STATE_RXFRAME_FINISHED
Definition: nrf_802154_trx.h:70
@ TRX_STATE_RXACK
Definition: nrf_802154_trx.h:72
@ TRX_STATE_TXFRAME
Definition: nrf_802154_trx.h:73
@ TRX_STATE_STANDALONE_CCA
Definition: nrf_802154_trx.h:75
@ TRX_STATE_CONTINUOUS_CARRIER
Definition: nrf_802154_trx.h:76
@ TRX_STATE_FINISHED
Definition: nrf_802154_trx.h:86
@ TRX_STATE_IDLE
Definition: nrf_802154_trx.h:60
@ TRX_STATE_DISABLED
Definition: nrf_802154_trx.h:59
@ TRX_STATE_ENERGY_DETECTION
Definition: nrf_802154_trx.h:78
@ TRX_STATE_RXFRAME
Definition: nrf_802154_trx.h:62
void nrf_802154_trx_abort(void)
Aborts currently performed operation.
bool nrf_802154_trx_rssi_measure(void)
Starts RSSI measurement.
void nrf_802154_trx_receive_ack(void)
Puts the trx module into receive ACK mode.
void nrf_802154_trx_energy_detection_finished(uint8_t ed_sample)
Handler called when energy detection operation has been just finished.
bool nrf_802154_trx_receive_buffer_set(void *p_receive_buffer)
Sets pointer to a receive buffer.
bool nrf_802154_trx_rssi_sample_is_available(void)
Checks if RSSI sample is available.
void nrf_802154_trx_enable(void)
Enables trx module.
bool nrf_802154_trx_receive_is_buffer_missing(void)
Checks if current receive operation was started without providing receive buffer.
void nrf_802154_trx_transmit_frame(const void *p_transmit_buffer, nrf_802154_trx_ramp_up_trigger_mode_t rampup_trigg_mode, uint8_t cca_attempts, const nrf_802154_fal_tx_power_split_t *p_tx_power, nrf_802154_trx_transmit_notifications_t notifications_mask)
Begins frame transmit operation.
const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_ready_event_handle_get(void)
Returns RADIO->EVENTS_READY handle that hardware can subscribe to.
const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_phyend_event_handle_get(void)
Returns RADIO->EVENTS_PHYEND handle that hardware can subscribe to.
void nrf_802154_trx_cca_configuration_update(void)
Updates CCA configuration in the RADIO peripheral according to PIB.
void nrf_802154_trx_receive_frame_prestarted(void)
Handler called at the beginning of frame reception (earliest possible moment).
void nrf_802154_trx_go_idle_finished(void)
Handler called when trx module reached IDLE state.
const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_end_event_handle_get(void)
Returns RADIO->EVENTS_END handle that hardware can subscribe to.
void nrf_802154_trx_receive_frame_received(void)
Handler called when a frame is received with correct crc.
void nrf_802154_trx_receive_frame_crcerror(void)
Handler called when a frame is received with incorrect crc.
void nrf_802154_trx_energy_detection(uint32_t ed_count)
Puts trx module into energy detection mode.
nrf_802154_trx_receive_notifications_t
Notifications that can be enabled for nrf_802154_trx_receive_frame operation.
Definition: nrf_802154_trx.h:98
@ TRX_RECEIVE_NOTIFICATION_NONE
No notifications during frame receive provided.
Definition: nrf_802154_trx.h:100
@ TRX_RECEIVE_NOTIFICATION_PRESTARTED
Notification nrf_802154_trx_receive_frame_prestarted enabled.
Definition: nrf_802154_trx.h:103
@ TRX_RECEIVE_NOTIFICATION_STARTED
Notification nrf_802154_trx_receive_frame_started enabled.
Definition: nrf_802154_trx.h:106
void nrf_802154_trx_antenna_update(void)
Updates currently used antenna.
trx_state_t nrf_802154_trx_state_get(void)
Gets current state of the TRX module.
void nrf_802154_trx_receive_frame(uint8_t bcc, nrf_802154_trx_ramp_up_trigger_mode_t rampup_trigg_mode, nrf_802154_trx_receive_notifications_t notifications_mask, const nrf_802154_fal_tx_power_split_t *p_ack_tx_power)
Puts the trx module into receive frame mode.
void nrf_802154_trx_transmit_frame_ccaidle(void)
Handler called when a cca operation during transmit attempt was successful.
uint32_t nrf_802154_trx_ramp_up_ppi_channel_get(void)
Gets (D)PPI channel used to trigger ramp up procedure start.
void nrf_802154_trx_disable(void)
Disables trx module.
bool nrf_802154_trx_go_idle(void)
Puts trx module into IDLE mode.
void nrf_802154_trx_transmit_frame_transmitted(void)
Handler called when frame transmission has just been finished.
void nrf_802154_trx_transmit_frame_ccabusy(void)
Handler called when a cca operation during transmit attempt failed.
nrf_802154_trx_ramp_up_trigger_mode_t
Radio ramp up procedure triggering modes.
Definition: nrf_802154_trx.h:91
@ TRX_RAMP_UP_SW_TRIGGER
Triggering by RADIO_DISABLED, which is a software generated event.
Definition: nrf_802154_trx.h:92
@ TRX_RAMP_UP_HW_TRIGGER
Triggering by some other event that needs to publish to a dedicated (D)PPI channel.
Definition: nrf_802154_trx.h:93
void nrf_802154_trx_standalone_cca_finished(bool channel_was_idle)
Handler called when standalone cca operaion has been just finished.
void nrf_802154_trx_standalone_cca(void)
Starts standalone cca operation.
void nrf_802154_trx_receive_ack_crcerror(void)
Handler called when an ack is received with incorrect crc.
void nrf_802154_trx_transmit_frame_started(void)
Handler called when frame transmission has just started.
void nrf_802154_trx_channel_set(uint8_t channel)
Sets radio channel to use.
void nrf_802154_trx_receive_frame_started(void)
Handler called at the beginning of frame reception.
void nrf_802154_trx_transmit_frame_ccastarted(void)
Handler called when a cca operation during transmit attempt started.
nrf_802154_trx_transmit_notifications_t
Notifications that can be enabled for nrf_802154_trx_transmit_frame operation.
Definition: nrf_802154_trx.h:111
@ TRX_TRANSMIT_NOTIFICATION_NONE
No notifications during frame transmission provided.
Definition: nrf_802154_trx.h:113
@ TRX_TRANSMIT_NOTIFICATION_CCAIDLE
Notification nrf_802154_trx_transmit_frame_ccaidle.
Definition: nrf_802154_trx.h:116
@ TRX_TRANSMIT_NOTIFICATION_CCASTARTED
Notification nrf_802154_trx_transmit_frame_ccastarted.
Definition: nrf_802154_trx.h:119
bool nrf_802154_trx_transmit_ack(const void *p_transmit_buffer, uint32_t delay_us)
Puts the trx module into transmit ACK mode.
bool nrf_802154_trx_psdu_is_being_received(void)
Check if PSDU is currently being received.
uint8_t nrf_802154_trx_rssi_last_sample_get(void)
Returns last measured RSSI sample.
const nrf_802154_sl_event_handle_t * nrf_802154_trx_radio_crcok_event_handle_get(void)
Returns RADIO->EVENTS_CRCOK handle that hardware can subscribe to.
bool nrf_802154_trx_rssi_measure_is_started(void)
Checks if RSSI measurement is currently started.
uint8_t nrf_802154_trx_receive_frame_bcmatched(uint8_t bcc)
Handler called during reception of a frame, when given number of bytes is received.
void nrf_802154_trx_transmit_ack_transmitted(void)
Handler called when ack transmission has just been finished.
void nrf_802154_trx_transmit_ack_started(void)
Handler called when ack transmission has just been started.