@@ -36,6 +36,8 @@ static void ieee802154_cc13xx_cc26xx_subg_data_init(
36
36
struct ieee802154_cc13xx_cc26xx_subg_data * drv_data );
37
37
static int ieee802154_cc13xx_cc26xx_subg_stop (
38
38
const struct device * dev );
39
+ static int ieee802154_cc13xx_cc26xx_subg_stop_if (
40
+ const struct device * dev );
39
41
static int ieee802154_cc13xx_cc26xx_subg_rx (
40
42
const struct device * dev );
41
43
static void ieee802154_cc13xx_cc26xx_subg_setup_rx_buffers (
@@ -66,6 +68,12 @@ static uint32_t overrides_sub_ghz[] = {
66
68
(uint32_t )0xFFFFFFFF
67
69
};
68
70
71
+ /** RF patches to use (note: RF core keeps a pointer to this, so no stack). */
72
+ static RF_Mode rf_mode = {
73
+ .rfMode = RF_MODE_MULTIPLE ,
74
+ .cpePatchFxn = & rf_patch_cpe_multi_protocol ,
75
+ };
76
+
69
77
/* Sub GHz power table */
70
78
static const RF_TxPowerTable_Entry txPowerTable_sub_ghz [] = {
71
79
{ -20 , RF_TxPowerTable_DEFAULT_PA_ENTRY (0 , 3 , 0 , 2 ) },
@@ -493,10 +501,14 @@ static void ieee802154_cc13xx_cc26xx_subg_rx_done(
493
501
494
502
static int ieee802154_cc13xx_cc26xx_subg_start (const struct device * dev )
495
503
{
496
- ARG_UNUSED (dev );
504
+ /* Start RX */
505
+ (void )ieee802154_cc13xx_cc26xx_subg_rx (dev );
497
506
return 0 ;
498
507
}
499
508
509
+ /**
510
+ * Flushes / stops all radio commands in RF queue.
511
+ */
500
512
static int ieee802154_cc13xx_cc26xx_subg_stop (const struct device * dev )
501
513
{
502
514
struct ieee802154_cc13xx_cc26xx_subg_data * drv_data =
@@ -515,6 +527,26 @@ static int ieee802154_cc13xx_cc26xx_subg_stop(const struct device *dev)
515
527
return 0 ;
516
528
}
517
529
530
+ /**
531
+ * Stops the sub-GHz interface and yields the radio (tells RF module to power
532
+ * down).
533
+ */
534
+ static int ieee802154_cc13xx_cc26xx_subg_stop_if (const struct device * dev )
535
+ {
536
+ struct ieee802154_cc13xx_cc26xx_subg_data * drv_data =
537
+ get_dev_data (dev );
538
+ int ret ;
539
+
540
+ ret = ieee802154_cc13xx_cc26xx_subg_stop (dev );
541
+ if (ret < 0 ) {
542
+ return ret ;
543
+ }
544
+
545
+ /* power down radio */
546
+ RF_yield (drv_data -> rf_handle );
547
+ return 0 ;
548
+ }
549
+
518
550
static int
519
551
ieee802154_cc13xx_cc26xx_subg_configure (const struct device * dev ,
520
552
enum ieee802154_config_type type ,
@@ -602,7 +634,7 @@ static struct ieee802154_radio_api
602
634
.set_txpower = ieee802154_cc13xx_cc26xx_subg_set_txpower ,
603
635
.tx = ieee802154_cc13xx_cc26xx_subg_tx ,
604
636
.start = ieee802154_cc13xx_cc26xx_subg_start ,
605
- .stop = ieee802154_cc13xx_cc26xx_subg_stop ,
637
+ .stop = ieee802154_cc13xx_cc26xx_subg_stop_if ,
606
638
.configure = ieee802154_cc13xx_cc26xx_subg_configure ,
607
639
.get_subg_channel_count =
608
640
ieee802154_cc13xx_cc26xx_subg_get_subg_channel_count ,
@@ -612,10 +644,6 @@ static int ieee802154_cc13xx_cc26xx_subg_init(const struct device *dev)
612
644
{
613
645
RF_Params rf_params ;
614
646
RF_EventMask reason ;
615
- RF_Mode rf_mode = {
616
- .rfMode = RF_MODE_MULTIPLE ,
617
- .cpePatchFxn = & rf_patch_cpe_multi_protocol ,
618
- };
619
647
struct ieee802154_cc13xx_cc26xx_subg_data * drv_data =
620
648
get_dev_data (dev );
621
649
0 commit comments