nRF5 SDK for Thread and Zigbee v3.2.0
Functions
Calls to higher layer

Functions

void nrf_802154_tx_ack_started (const uint8_t *p_data)
 Notify that transmitting the ACK frame has started. More...
 
void nrf_802154_received (uint8_t *p_data, uint8_t length, int8_t power, uint8_t lqi)
 Notify that a frame was received. More...
 
void nrf_802154_received_timestamp (uint8_t *p_data, uint8_t length, int8_t power, uint8_t lqi, uint32_t time)
 Notify that a frame was received at a given time. More...
 
void nrf_802154_receive_failed (nrf_802154_rx_error_t error)
 Notify that reception of a frame failed. More...
 
void nrf_802154_tx_started (const uint8_t *p_frame)
 Notify that transmitting a frame has started. More...
 
void nrf_802154_transmitted (const uint8_t *p_frame, uint8_t *p_ack, uint8_t length, int8_t power, uint8_t lqi)
 Notify that a frame was transmitted. More...
 
void nrf_802154_transmitted_timestamp (const uint8_t *p_frame, uint8_t *p_ack, uint8_t length, int8_t power, uint8_t lqi, uint32_t time)
 Notify that a frame was transmitted. More...
 
void nrf_802154_transmit_failed (const uint8_t *p_frame, nrf_802154_tx_error_t error)
 Notify that a frame was not transmitted due to busy channel. More...
 
void nrf_802154_energy_detected (uint8_t result)
 Notify that the energy detection procedure finished. More...
 
void nrf_802154_energy_detection_failed (nrf_802154_ed_error_t error)
 Notify that the energy detection procedure failed. More...
 
void nrf_802154_cca_done (bool channel_free)
 Notify that the CCA procedure has finished. More...
 
void nrf_802154_cca_failed (nrf_802154_cca_error_t error)
 Notify that the CCA procedure failed. More...
 

Detailed Description

Function Documentation

void nrf_802154_cca_done ( bool  channel_free)

Notify that the CCA procedure has finished.

Parameters
[in]channel_freeIndication if channel is free.
void nrf_802154_cca_failed ( nrf_802154_cca_error_t  error)

Notify that the CCA procedure failed.

Parameters
[in]errorReason of the failure.
void nrf_802154_energy_detected ( uint8_t  result)

Notify that the energy detection procedure finished.

Note
This function passes the EnergyLevel defined in the 802.15.4-2006 specification: 0x00 - 0xff proportional to detected energy level (dBm above receiver sensitivity). To calculate the result in dBm, use nrf_802154_dbm_from_energy_level_calculate.
Parameters
[in]resultMaximum energy detected during the energy detection procedure.
void nrf_802154_energy_detection_failed ( nrf_802154_ed_error_t  error)

Notify that the energy detection procedure failed.

Parameters
[in]errorReason of the failure.
void nrf_802154_receive_failed ( nrf_802154_rx_error_t  error)

Notify that reception of a frame failed.

Parameters
[in]errorAn error code that indicates the reason of the failure.
void nrf_802154_received ( uint8_t *  p_data,
uint8_t  length,
int8_t  power,
uint8_t  lqi 
)

Notify that a frame was received.

Note
The buffer pointed to by p_data is not modified by the radio driver (and cannot be used to receive a frame) until nrf_802154_buffer_free is called.
The buffer pointed to by p_data may be modified by the function handler (and other modules) until nrf_802154_buffer_free is called.
*       p_data
*       v
* +-----+-----------------------------------------------------------+------------+
* | PHR | MAC Header and payload                                    | FCS        |
* +-----+-----------------------------------------------------------+------------+
*       |                                                           |
*       | <------------------ length -----------------------------> |
* 
Parameters
[in]p_dataPointer to the buffer containing the payload of the received frame (PSDU without FCS).
[in]lengthLength of received payload.
[in]powerRSSI of received frame.
[in]lqiLQI of received frame.
void nrf_802154_received_timestamp ( uint8_t *  p_data,
uint8_t  length,
int8_t  power,
uint8_t  lqi,
uint32_t  time 
)

Notify that a frame was received at a given time.

This functions works like nrf_802154_received and adds a timestamp to the parameter list.

Note
The received frame usually contains timestamp. However, due to a race condition, the timestamp may be invalid. This erroneous situation is indicated by the NRF_802154_NO_TIMESTAMP value of the time parameter.
Parameters
[in]p_dataPointer to the buffer containing the payload of the received frame (PSDU without FCS).
[in]lengthLength of received payload.
[in]powerRSSI of received frame.
[in]lqiLQI of received frame.
[in]timeTimestamp taken when the last symbol of the frame was received (in us) or NRF_802154_NO_TIMESTAMP if the timestamp is invalid.
void nrf_802154_transmit_failed ( const uint8_t *  p_frame,
nrf_802154_tx_error_t  error 
)

Notify that a frame was not transmitted due to busy channel.

This function is called if the transmission procedure fails.

Parameters
[in]p_framePointer to the buffer containing PSDU of the frame that was not transmitted.
[in]errorReason of the failure.
void nrf_802154_transmitted ( const uint8_t *  p_frame,
uint8_t *  p_ack,
uint8_t  length,
int8_t  power,
uint8_t  lqi 
)

Notify that a frame was transmitted.

Note
If ACK was requested for the transmitted frame, this function is called after a proper ACK is received. If ACK was not requested, this function is called just after transmission has ended.
The buffer pointed to by p_ack is not modified by the radio driver (and cannot be used to receive a frame) until nrf_802154_buffer_free is called.
The buffer pointed to by p_ack may be modified by the function handler (and other modules) until nrf_802154_buffer_free is called.
The next higher layer should handle either nrf_802154_transmitted or nrf_802154_transmitted_raw. It should not handle both functions.
Parameters
[in]p_framePointer to the buffer containing PSDU of the transmitted frame.
[in]p_ackPointer to the buffer containing the received ACK payload (PHR excluding FCS). If ACK was not requested, p_ack is set to NULL.
[in]lengthLength of the received ACK payload or 0 if ACK was not requested.
[in]powerRSSI of received frame or 0 if ACK was not requested.
[in]lqiLQI of received frame or 0 if ACK was not requested.
void nrf_802154_transmitted_timestamp ( const uint8_t *  p_frame,
uint8_t *  p_ack,
uint8_t  length,
int8_t  power,
uint8_t  lqi,
uint32_t  time 
)

Notify that a frame was transmitted.

This functions works like nrf_802154_transmitted and adds a timestamp to the parameter list.

Note
timestamp may be inaccurate due to software latency (IRQ handling).
timestamp granularity depends on the granularity of the timer driver in the platform/timer directory.
Including a timestamp for received frames uses resources like CPU time and memory. If the timestamp is not required, use nrf_802154_received instead.
Parameters
[in]p_framePointer to the buffer containing PSDU of the transmitted frame.
[in]p_ackPointer to the buffer containing the received ACK payload (PHR excluding FCS). If ACK was not requested, p_ack is set to NULL.
[in]lengthLength of the received ACK payload.
[in]powerRSSI of received frame or 0 if ACK was not requested.
[in]lqiLQI of received frame or 0 if ACK was not requested.
[in]timeTimestamp taken when the last symbol of ACK is received or 0 if ACK was not requested.
void nrf_802154_tx_ack_started ( const uint8_t *  p_data)

Notify that transmitting the ACK frame has started.

Note
This function should be very short to prevent dropping frames by the driver.
Parameters
[in]p_dataPointer to buffer containing ACK data (PHR + PSDU).
void nrf_802154_tx_started ( const uint8_t *  p_frame)

Notify that transmitting a frame has started.

Note
Usually, nrf_802154_transmitted is called shortly after this function. However, if the transmit procedure is interrupted, it might happen that nrf_802154_transmitted is not called.
This function should be very short to prevent dropping frames by the driver.
Parameters
[in]p_framePointer to the buffer containing PSDU of the frame being transmitted.

Documentation feedback | Developer Zone | Subscribe | Updated