Skip to content

Commit db3d1ae

Browse files
AdamZelikNSrlubos
authored andcommitted
drivers: nrf_radio_802154: Add callout for custom initialization part
This commit introduces nrf_802154_custom_part_of_radio_init callout. Application can override weak empty implementation to provide some additional operations to be performed at the beginning of each new timeslot. Signed-off-by: Adam Zelik <[email protected]>
1 parent 8e132fe commit db3d1ae

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

drivers/nrf_radio_802154/src/nrf_802154.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,11 @@ uint32_t nrf_802154_time_get(void)
842842
return nrf_802154_timer_sched_time_get();
843843
}
844844

845+
__WEAK void nrf_802154_custom_part_of_radio_init(void)
846+
{
847+
// Intentionally empty
848+
}
849+
845850
__WEAK void nrf_802154_tx_ack_started(const uint8_t * p_data)
846851
{
847852
(void)p_data;

drivers/nrf_radio_802154/src/nrf_802154.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ void nrf_802154_init(void);
7272
*/
7373
void nrf_802154_deinit(void);
7474

75+
/**
76+
* @brief Perform some additional operations during initialization of the RADIO peripheral.
77+
*
78+
* By implementing this function the higher layer can provide some additional operations
79+
* to be performed at the beginning of each new timeslot. These can in particular be
80+
* modifications of RADIO peripheral register values.
81+
*/
82+
extern void nrf_802154_custom_part_of_radio_init(void);
83+
7584
#if !NRF_802154_INTERNAL_RADIO_IRQ_HANDLING
7685
/**
7786
* @brief Handles the interrupt request from the RADIO peripheral.

drivers/nrf_radio_802154/src/nrf_802154_trx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ void nrf_802154_trx_enable(void)
444444
// Set channel
445445
channel_set(nrf_802154_pib_channel_get());
446446

447+
// Custom initialization operations
448+
nrf_802154_custom_part_of_radio_init();
449+
447450
irq_init();
448451

449452
assert(nrf_radio_shorts_get(NRF_RADIO) == SHORTS_IDLE);

0 commit comments

Comments
 (0)