Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit 9eca9b4

Browse files
auroraslbwopu-ot
authored andcommitted
Add APIs for RADIO
Signed-off-by: Sletnes Bjørlo, Aurora <[email protected]>
1 parent afde642 commit 9eca9b4

File tree

4 files changed

+664
-0
lines changed

4 files changed

+664
-0
lines changed

src/HW_models/NRF_RADIO.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,21 @@ void nrf_radio_regw_sideeffects_TASKS_DISABLE(){
368368
}
369369
}
370370

371+
void nrf_radio_regw_sideeffects_TASKS_RSSISTART() {
372+
//We don't need to model this as per now
373+
if ( NRF_RADIO_regs.TASKS_RSSISTART ){
374+
NRF_RADIO_regs.TASKS_RSSISTART = 0;
375+
bs_trace_warning_line_time("RADIO: Sampling RSSI by writing to TASK_RSSISTART register is not supported by the model\n");
376+
}
377+
}
378+
379+
void nrf_radio_regw_sideeffects_TASKS_RSSISTOP() {
380+
//We don't need to model this as per now
381+
if ( NRF_RADIO_regs.TASKS_RSSISTOP ){
382+
NRF_RADIO_regs.TASKS_RSSISTOP = 0;
383+
bs_trace_warning_line_time("RADIO: Sampling RSSI by writing to TASK_RSSISTOP register is not supported by the model\n");
384+
}
385+
}
371386

372387
void nrf_radio_regw_sideeffects_INTENSET(){
373388
if ( NRF_RADIO_regs.INTENSET ){

src/HW_models/NRF_RADIO.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ void nrf_radio_bitcounter_timer_triggered();
3434
void nrf_radio_regw_sideeffects_BCC();
3535
void nrf_radio_regw_sideeffects_POWER();
3636
void nrf_radio_regw_sideeffects_TASKS_DISABLE();
37+
void nrf_radio_regw_sideeffects_TASKS_RSSISTART();
38+
void nrf_radio_regw_sideeffects_TASKS_RSSISTOP();
3739
void nrf_radio_regw_sideeffects_TASKS_RXEN();
3840
void nrf_radio_regw_sideeffects_TASKS_TXEN();
3941
void nrf_radio_regw_sideeffects_INTENSET();
42+
void nrf_radio_regw_sideeffects_INTENCLR();
4043

4144
#ifdef __cplusplus
4245
}

src/nrfx/hal/nrf_radio.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ void nrf_radio_task_trigger(NRF_RADIO_Type * p_reg, nrf_radio_task_t task)
2020
} else if ( task == NRF_RADIO_TASK_DISABLE ) {
2121
p_reg->TASKS_DISABLE = 1;
2222
nrf_radio_regw_sideeffects_TASKS_DISABLE();
23+
} else if ( task == NRF_RADIO_TASK_RSSISTOP ) {
24+
p_reg->TASKS_RSSISTOP = 1;
25+
nrf_radio_regw_sideeffects_TASKS_RSSISTOP();
26+
} else if ( task == NRF_RADIO_TASK_RSSISTART ) {
27+
p_reg->TASKS_RSSISTART = 1;
28+
nrf_radio_regw_sideeffects_TASKS_RSSISTART();
2329
} else {
2430
bs_trace_error_line_time("Not supported task started in nrf_radio\n");
2531
}
@@ -31,6 +37,12 @@ void nrf_radio_int_enable(NRF_RADIO_Type * p_reg, uint32_t mask)
3137
nrf_radio_regw_sideeffects_INTENSET();
3238
}
3339

40+
void nrf_radio_int_disable(NRF_RADIO_Type * p_reg, uint32_t mask)
41+
{
42+
p_reg->INTENCLR = mask;
43+
nrf_radio_regw_sideeffects_INTENCLR();
44+
}
45+
3446
void nrf_radio_bcc_set(NRF_RADIO_Type * p_reg, uint32_t radio_bcc)
3547
{
3648
p_reg->BCC = radio_bcc;

0 commit comments

Comments
 (0)