Skip to content

Commit ee333b2

Browse files
committed
nrf_802154: rev 3383cdf282806f0bbdd55e68974820d00be1c41d
This commit updates revision of the nrf_802154 component. Signed-off-by: Piotr Koziar <[email protected]>
1 parent 6f4076e commit ee333b2

File tree

2 files changed

+110
-38
lines changed

2 files changed

+110
-38
lines changed

nrf_802154/doc/api.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,157 +13,203 @@ Setting addresses and PAN ID of the device
1313
******************************************
1414

1515
.. doxygengroup:: nrf_802154_addresses
16+
:project: nrfxlib
17+
:members:
1618

1719
.. _radiodriver_api_data:
1820

1921
Functions to calculate data given by the driver
2022
***********************************************
2123

2224
.. doxygengroup:: nrf_802154_data
25+
:project: nrfxlib
26+
:members:
2327

2428
.. _radiodriver_api_transitions:
2529

2630
Functions to request FSM transitions and check the current state
2731
****************************************************************
2832

2933
.. doxygengroup:: nrf_802154_transitions
34+
:project: nrfxlib
35+
:members:
3036

3137
.. _radiodriver_api_calls:
3238

3339
Calls to the higher layer
3440
*************************
3541

3642
.. doxygengroup:: nrf_802154_calls
43+
:project: nrfxlib
44+
:members:
3745

3846
.. _radiodriver_api_memman:
3947

4048
Driver memory management
4149
************************
4250

4351
.. doxygengroup:: nrf_802154_memman
52+
:project: nrfxlib
53+
:members:
4454

4555
.. _radiodriver_api_rssi:
4656

4757
RSSI measurement function
4858
*************************
4959

5060
.. doxygengroup:: nrf_802154_rssi
61+
:project: nrfxlib
62+
:members:
5163

5264
.. _radiodriver_api_prom:
5365

5466
Promiscuous mode
5567
****************
5668

5769
.. doxygengroup:: nrf_802154_prom
70+
:project: nrfxlib
71+
:members:
5872

5973
.. _radiodriver_api_autoack:
6074

6175
Auto ACK management
6276
*******************
6377

6478
.. doxygengroup:: nrf_802154_autoack
79+
:project: nrfxlib
80+
:members:
6581

6682
.. _radiodriver_api_cca:
6783

6884
CCA configuration management
6985
****************************
7086

7187
.. doxygengroup:: nrf_802154_cca
88+
:project: nrfxlib
89+
:members:
7290

7391
.. _radiodriver_api_csma:
7492

7593
CSMA-CA procedure
7694
*****************
7795

7896
.. doxygengroup:: nrf_802154_csma
97+
:project: nrfxlib
98+
:members:
7999

80100
.. _radiodriver_api_timeout:
81101

82102
ACK timeout procedure
83103
*********************
84104

85105
.. doxygengroup:: nrf_802154_timeout
106+
:project: nrfxlib
107+
:members:
86108

87109
.. _radiodriver_api_stats:
88110

89111
Statistics and measurements
90112
***************************
91113

92114
.. doxygengroup:: nrf_802154_stats
115+
:project: nrfxlib
116+
:members:
93117

94118
.. _radiodriver_api_ifs:
95119

96120
Inter-frame spacing feature
97121
***************************
98122

99123
.. doxygengroup:: nrf_802154_ifs
124+
:project: nrfxlib
125+
:members:
100126

101127
.. _radiodriver_api_capabilities:
102128

103129
Radio driver run-time capabilities feature
104130
******************************************
105131

106132
.. doxygengroup:: nrf_802154_capabilities
133+
:project: nrfxlib
134+
:members:
107135

108136
.. _radiodriver_api_security:
109137

110138
Radio driver MAC security feature
111139
*********************************
112140

113141
.. doxygengroup:: nrf_802154_security
142+
:project: nrfxlib
143+
:members:
114144

115145
.. _radiodriver_api_ie_writer:
116146

117147
Radio driver Information Element data injection feature
118148
*******************************************************
119149

120150
.. doxygengroup:: nrf_802154_ie_writer
151+
:project: nrfxlib
152+
:members:
121153

122154
.. _radiodriver_api_config_radio:
123155

124156
Radio driver configuration
125157
**************************
126158

127159
.. doxygengroup:: nrf_802154_config_radio
160+
:project: nrfxlib
161+
:members:
128162

129163
.. _radiodriver_api_config_csma:
130164

131165
CSMA/CA procedure configuration
132166
*******************************
133167

134168
.. doxygengroup:: nrf_802154_config_csma
169+
:project: nrfxlib
170+
:members:
135171

136172
.. _radiodriver_api_config_timeout:
137173

138174
ACK timeout feature configuration
139175
*********************************
140176

141177
.. doxygengroup:: nrf_802154_config_timeout
178+
:project: nrfxlib
179+
:members:
142180

143181
.. _radiodriver_api_config_transmission:
144182

145183
Transmission start notification feature configuration
146184
*****************************************************
147185

148186
.. doxygengroup:: nrf_802154_config_transmission
187+
:project: nrfxlib
188+
:members:
149189

150190
.. _radiodriver_api_ie:
151191

152192
Information Elements configuration
153193
**********************************
154194

155195
.. doxygengroup:: nrf_802154_ie
196+
:project: nrfxlib
197+
:members:
156198

157199
.. _radiodriver_api_other:
158200

159201
Interrupt Handlers
160202
******************
161203

162204
.. doxygengroup:: nrf_802154_irq
205+
:project: nrfxlib
206+
:members:
163207

164208
.. _radiodriver_api_irq:
165209

166210
Other functions
167211
***************
168212

169213
.. doxygengroup:: nrf_802154
214+
:project: nrfxlib
215+
:members:

nrf_802154/driver/src/nrf_802154_trx.c

Lines changed: 64 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -333,37 +333,81 @@ static void timer_frequency_set_1mhz(void)
333333
nrf_timer_prescaler_set(NRF_802154_TIMER_INSTANCE, prescaler);
334334
}
335335

336+
/** Disables the radio no matter its state. */
337+
static void radio_force_disable(void)
338+
{
339+
/* Radio cannot be disabled if EVENT_DISABLED is set. Clear it first. */
340+
nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED);
341+
nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_DISABLE);
342+
}
343+
344+
/** Robustly disable the radio peripheral based on the radio state. */
345+
static void radio_robust_disable(void)
346+
{
347+
nrf_radio_state_t radio_state = nrf_radio_state_get(NRF_RADIO);
348+
349+
if ((radio_state == NRF_RADIO_STATE_RXDISABLE) || (radio_state == NRF_RADIO_STATE_TXDISABLE))
350+
{
351+
/* RADIO is in an unstable state that should resolve to DISABLED. Do nothing. */
352+
}
353+
else
354+
{
355+
/* RADIO is in a stable state and needs to be transitioned to DISABLED manually. */
356+
radio_force_disable();
357+
}
358+
}
359+
336360
static inline void wait_until_radio_is_disabled(void)
337361
{
338362
nrf_802154_log_function_enter(NRF_802154_LOG_VERBOSITY_HIGH);
339363

340364
bool radio_is_disabled = false;
365+
bool repeat = false;
366+
367+
do
368+
{
369+
/* RADIO should enter DISABLED state after no longer than RX ramp-down time or TX ramp-down
370+
* time, depending on its initial state before TASK_DISABLE was triggered. The loop below busy
371+
* waits for the state transition to complete. To prevent the CPU from spinning in an endless
372+
* loop, the maximum allowed number of loop cycles is limited. The limit's intention is not to
373+
* approximate the expected maximum time the transition might actually take, which is generally
374+
* very short, but to act as a safeguard against obviously incorrect and unexpected behaviors.
375+
* In practice, in most cases the radio will have already changed state to DISABLED before this
376+
* function starts. In the remaining cases several cycles of the loop should be sufficient for
377+
* the transition to complete.
378+
*/
379+
for (uint32_t i = 0; i < MAX_RAMPDOWN_CYCLES; i++)
380+
{
381+
if (nrf_radio_state_get(NRF_RADIO) == NRF_RADIO_STATE_DISABLED)
382+
{
383+
radio_is_disabled = true;
384+
break;
385+
}
386+
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
387+
nrf_802154_delay_us(1);
388+
/* In this simulated board, and in general in the POSIX ARCH,
389+
* code takes 0 simulated time to execute.
390+
* Let's hold for 1 microsecond to allow the RADIO HW to clear the state
391+
*/
392+
#endif
393+
}
341394

342-
/* RADIO should enter DISABLED state after no longer than RX ramp-down time or TX ramp-down
343-
* time, depending on its initial state before TASK_DISABLE was triggered. The loop below busy
344-
* waits for the state transition to complete. To prevent the CPU from spinning in an endless
345-
* loop, the maximum allowed number of loop cycles is limited. The limit's intention is not to
346-
* approximate the expected maximum time the transition might actually take, which is generally
347-
* very short, but to act as a safeguard against obviously incorrect and unexpected behaviors.
348-
* In practice, in most cases the radio will have already changed state to DISABLED before this
349-
* function starts. In the remaining cases several cycles of the loop should be sufficient for
350-
* the transition to complete.
351-
*/
352-
for (uint32_t i = 0; i < MAX_RAMPDOWN_CYCLES; i++)
353-
{
354-
if (nrf_radio_state_get(NRF_RADIO) == NRF_RADIO_STATE_DISABLED)
395+
#ifdef NRF54L_SERIES
396+
if (!radio_is_disabled && !repeat)
397+
{
398+
/* Radio still not in disabled state.
399+
* Manually disable the radio and repeat the loop once as a last resort.
400+
*/
401+
radio_force_disable();
402+
repeat = true;
403+
}
404+
else
355405
{
356-
radio_is_disabled = true;
357406
break;
358407
}
359-
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
360-
nrf_802154_delay_us(1);
361-
/* In this simulated board, and in general in the POSIX ARCH,
362-
* code takes 0 simulated time to execute.
363-
* Let's hold for 1 microsecond to allow the RADIO HW to clear the state
364-
*/
365408
#endif
366409
}
410+
while (repeat);
367411

368412
NRF_802154_ASSERT(radio_is_disabled);
369413
(void)radio_is_disabled;
@@ -525,24 +569,6 @@ static void nrf_radio_reset(void)
525569
nrf_802154_log_function_exit(NRF_802154_LOG_VERBOSITY_LOW);
526570
}
527571

528-
/** Robustly disable the radio peripheral. */
529-
static void radio_robust_disable(void)
530-
{
531-
nrf_radio_state_t radio_state = nrf_radio_state_get(NRF_RADIO);
532-
533-
if ((radio_state == NRF_RADIO_STATE_RXDISABLE) || (radio_state == NRF_RADIO_STATE_TXDISABLE))
534-
{
535-
/* RADIO is in an unstable state that should resolve to DISABLED. Do nothing. */
536-
}
537-
else
538-
{
539-
/* RADIO is in a stable state and needs to be transitioned to DISABLED manually.
540-
* It cannot be disabled if EVENT_DISABLED is set. Clear it first. */
541-
nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED);
542-
nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_DISABLE);
543-
}
544-
}
545-
546572
static void channel_set(uint8_t channel)
547573
{
548574
NRF_802154_ASSERT(channel >= 11U && channel <= 26U);

0 commit comments

Comments
 (0)