35#ifndef NRF_802154_STATS_H_
36#define NRF_802154_STATS_H_
40#include "nrf_802154_sl_atomics.h"
42#ifdef __STATIC_INLINE__
43#undef __STATIC_INLINE__
46#ifdef NRF_802154_STATS_DECLARE_ONLY
47#define __STATIC_INLINE__
49#define __STATIC_INLINE__ __STATIC_INLINE
71#ifndef NRF_802154_STATS_DECLARE_ONLY
73#define __NRF_802154_STAT_COUNTER_INC_IMPL(_field_name) \
76 extern nrf_802154_stats_t g_nrf_802154_stats; \
77 nrf_802154_sl_atomic_add_u32(&g_nrf_802154_stats.counters._field_name, 1);\
81#define __NRF_80214_STAT_TIMESTAMP_WRITE_IMPL(_field_name, _value) \
84 extern nrf_802154_stats_t g_nrf_802154_stats; \
85 nrf_802154_sl_atomic_store_u64(&g_nrf_802154_stats.timestamps._field_name, (_value));\
91 __NRF_802154_STAT_COUNTER_INC_IMPL(cca_failed_attempts);
96 __NRF_802154_STAT_COUNTER_INC_IMPL(received_frames);
101 __NRF_802154_STAT_COUNTER_INC_IMPL(received_energy_events);
106 __NRF_802154_STAT_COUNTER_INC_IMPL(received_preambles);
111 __NRF_802154_STAT_COUNTER_INC_IMPL(coex_requests);
116 __NRF_802154_STAT_COUNTER_INC_IMPL(coex_granted_requests);
121 __NRF_802154_STAT_COUNTER_INC_IMPL(coex_denied_requests);
126 __NRF_802154_STAT_COUNTER_INC_IMPL(coex_unsolicited_grants);
131 __NRF_80214_STAT_TIMESTAMP_WRITE_IMPL(last_csmaca_start_timestamp, value);
136 __NRF_80214_STAT_TIMESTAMP_WRITE_IMPL(last_cca_start_timestamp, value);
141 __NRF_80214_STAT_TIMESTAMP_WRITE_IMPL(last_cca_idle_timestamp, value);
146 __NRF_80214_STAT_TIMESTAMP_WRITE_IMPL(last_tx_end_timestamp, value);
151 __NRF_80214_STAT_TIMESTAMP_WRITE_IMPL(last_ack_end_timestamp, value);
156 __NRF_80214_STAT_TIMESTAMP_WRITE_IMPL(last_rx_end_timestamp, value);
__STATIC_INLINE uint64_t nrf_802154_stat_timestamp_read_last_rx_end_timestamp(void)
Definition nrf_802154_stats.h:159
__STATIC_INLINE void nrf_802154_stat_timestamp_write_last_ack_end_timestamp(uint64_t value)
Definition nrf_802154_stats.h:149
__STATIC_INLINE void nrf_802154_stat_timestamp_write_last_cca_start_timestamp(uint64_t value)
Definition nrf_802154_stats.h:134
__STATIC_INLINE void nrf_802154_stat_counter_increment_received_frames(void)
Definition nrf_802154_stats.h:94
__STATIC_INLINE void nrf_802154_stat_timestamp_write_last_csmaca_start_timestamp(uint64_t value)
Definition nrf_802154_stats.h:129
__STATIC_INLINE void nrf_802154_stat_counter_increment_cca_failed_attempts(void)
Definition nrf_802154_stats.h:89
__STATIC_INLINE void nrf_802154_stat_counter_increment_received_energy_events(void)
Definition nrf_802154_stats.h:99
__STATIC_INLINE void nrf_802154_stat_counter_increment_coex_unsolicited_grants(void)
Definition nrf_802154_stats.h:124
__STATIC_INLINE void nrf_802154_stat_counter_increment_received_preambles(void)
Definition nrf_802154_stats.h:104
__STATIC_INLINE uint64_t nrf_802154_stat_timestamp_read_last_ack_end_timestamp(void)
Definition nrf_802154_stats.h:166
__STATIC_INLINE void nrf_802154_stat_counter_increment_coex_requests(void)
Definition nrf_802154_stats.h:109
__STATIC_INLINE void nrf_802154_stat_counter_increment_coex_denied_requests(void)
Definition nrf_802154_stats.h:119
__STATIC_INLINE void nrf_802154_stat_timestamp_write_last_tx_end_timestamp(uint64_t value)
Definition nrf_802154_stats.h:144
__STATIC_INLINE void nrf_802154_stat_counter_increment_coex_granted_requests(void)
Definition nrf_802154_stats.h:114
__STATIC_INLINE void nrf_802154_stat_timestamp_write_last_rx_end_timestamp(uint64_t value)
Definition nrf_802154_stats.h:154
__STATIC_INLINE void nrf_802154_stat_timestamp_write_last_cca_idle_timestamp(uint64_t value)
Definition nrf_802154_stats.h:139
uint64_t last_ack_end_timestamp
Definition nrf_802154_types.h:328
uint64_t last_rx_end_timestamp
Definition nrf_802154_types.h:329
nrf_802154_stat_timestamps_t timestamps
Definition nrf_802154_types.h:338
Type of structure holding statistics about the Radio Driver behavior.
Definition nrf_802154_types.h:336