Contiki-NG

A data strcuture representing the radio's primary mode of operation. More...

#include <arch/cpu/cc26x0-cc13x0/rf-core/rf-core.h>

Data Fields

void(* abort )(void)
 A pointer to a function used to abort the current radio op.
 
uint8_t(* restore )(void)
 A pointer to a function that will restore the previous radio op. More...
 
uint8_t(* is_on )(void)
 A pointer to a function that checks if the radio is on. More...
 
int16_t sfd_timestamp_offset
 Offset of the end of SFD when compared to the radio HW-generated timestamp.
 

Detailed Description

A data strcuture representing the radio's primary mode of operation.

The CC13xx / CC26xx radio supports up to potentially 3 modes: IEEE, Prop and BLE. Within Contiki, we assume that the radio is by default in one of IEEE or Prop in order to support standard 6LoWPAN / .15.4 operation. The BLE mode interrupts this so called "primary" mode in order to send BLE adv messages. Once BLE is done advertising, we need to be able to restore the previous .15.4 mode. Unfortunately, the only way this can be done with NETSTACK_RADIO API is by fully power-cycling the radio, which is something we do not want to do.

Thus, we declare a secondary data structure for primary mode drivers (IEEE or Prop). We use this data structure to issue "soft off" and "back on" commands. Soft off in this context means stopping RX (e.g. the respective IEEE RX operation), but without shutting down the RF core (which is what NETSTACK_RADIO.off() would have done). We then remember what mode we were using in order to be able to re-enter RX mode for this mode.

A NETSTACK_RADIO driver will declare those two functions somewhere within its module of implementation. During its init() routine, it will notify the RF core module so that the latter can abort and restore operations.

Definition at line 125 of file rf-core.h.

Field Documentation

◆ is_on

uint8_t(* rf_core_primary_mode_s::is_on) (void)

A pointer to a function that checks if the radio is on.

Returns
1 or 0

Definition at line 141 of file rf-core.h.

◆ restore

uint8_t(* rf_core_primary_mode_s::restore) (void)

A pointer to a function that will restore the previous radio op.

Returns
RF_CORE_CMD_OK or RF_CORE_CMD_ERROR

Definition at line 135 of file rf-core.h.