Loading...
Searching...
No Matches
cc2538_rf.h File Reference

Low-level radio driver for the CC2538. More...

Detailed Description

Low-level radio driver for the CC2538.

Author
Aaron Sowry aaron.nosp@m.@mut.nosp@m.ex.nz
Ian Martin ian@l.nosp@m.ocic.nosp@m.ontro.nosp@m.ls.c.nosp@m.om

Definition in file cc2538_rf.h.

#include <stdbool.h>
#include "board.h"
#include "cc2538_rfcore.h"
#include "net/ieee802154.h"
#include "kernel_defines.h"
#include "net/ieee802154/radio.h"
#include "net/netopt.h"
+ Include dependency graph for cc2538_rf.h:

Go to the source code of this file.

Data Structures

struct  cc2538_rf_t
 Device descriptor for CC2538 transceiver. More...
 
#define CC2538_AUTOCRC_LEN   (2)
 
#define CC2538_RF_FIFO_SIZE   (128)
 
#define CC2538_PACKET_LENGTH_SIZE   (1)
 
#define CC2538_RF_MAX_DATA_LEN   (CC2538_RF_FIFO_SIZE - CC2538_PACKET_LENGTH_SIZE)
 
#define IEEE802154_MIN_FREQ   (2405)
 Min.
 
#define IEEE802154_MAX_FREQ   (2480)
 Max.
 
#define IEEE802154_CHANNEL_SPACING   (5)
 Channel spacing in MHz

 
#define IEEE802154_CHAN2FREQ(chan)   ( IEEE802154_MIN_FREQ + ((chan) - IEEE802154_CHANNEL_MIN) * IEEE802154_CHANNEL_SPACING )
 
#define IEEE802154_FREQ2CHAN(freq)   ( IEEE802154_CHANNEL_MIN + ((freq) - IEEE802154_MIN_FREQ) / IEEE802154_CHANNEL_SPACING )
 
#define CC2538_MIN_FREQ   (2394)
 
#define CC2538_MAX_FREQ   (2507)
 
#define CC2538_RF_POWER_DEFAULT   (CONFIG_IEEE802154_DEFAULT_TXPOWER)
 Default output power in dBm.
 
#define CC2538_RF_CHANNEL_DEFAULT   (CONFIG_IEEE802154_DEFAULT_CHANNEL)
 
#define OUTPUT_POWER_MIN   (-24)
 Min output power in dBm.
 
#define OUTPUT_POWER_MAX   (7)
 Max output power in dBm.
 
#define NUM_POWER_LEVELS   ( OUTPUT_POWER_MAX - OUTPUT_POWER_MIN + 1 )
 
#define CC2538_CORR_VAL_MIN   (50U)
 
#define CC2538_CORR_VAL_MAX   (110U)
 
#define CC2538_CORR_VAL_MASK   (0x7F)
 
#define CC2538_CRC_BIT_MASK   (0x80)
 
#define CC2538_CCA_THR_MASK   (0x000000FF)
 CCA Threshold mask.
 
#define CC2538_CCA_MODE_MASK   (0x18)
 CCA Mode mask.
 
#define CC2538_CCA_MODE_POS   (3U)
 CCA Mode pos.
 
#define CC2538_CSP_SKIP_INST_MASK   (0x70)
 CSP Skip instruction mask.
 
#define CC2538_CSP_SKIP_INST_POS   (4U)
 CSP Skip instruction pos.
 
#define CC2538_CSP_SKIP_N_MASK   (0x08)
 CSP Skip condition negation mask.
 
#define CC2538_CSP_SKIP_COND_CCA   (0x00)
 CSP Skip condition is valid CCA.
 
#define CC2538_CSP_SKIP_COND_CSPZ   (0x06)
 CSP Skip condition is CSPZ is 0.
 
#define CC2538_CSP_SKIP_COND_RSSI   (0x07)
 CSP Skip condition is valid RSSI.
 
#define CC2538_SFR_MTMSEL_MASK   (0x7)
 MAC Timer selection mask.
 
#define CC2538_SFR_MTMSEL_TIMER_P   (0x2)
 Selects Timer period.
 
#define CC2538_MCTRL_SYNC_MASK   (0x2)
 Sync MAC Timer to external clock.
 
#define CC2538_MCTRL_RUN_MASK   (0x1)
 Run MAC Timer.
 
#define CC2538_CSP_MCU_CTRL_MASK   (0x1)
 MCU Ctrl mask.
 
#define CC2538_CSP_INCMAXY_MAX_MASK   (0x7)
 CSP INCMAXY instruction (increment Register CSPX without exceeding CSPY)
 
#define CC2538_RXENABLE_RXON_MASK   (0x80)
 RX on mask.
 
#define CC2538_RSSI_OFFSET   (-73)
 Signal strength offset value.
 
#define CC2538_RF_SENSITIVITY   (-97)
 dBm typical, normal conditions
 
#define CC2538_ACCEPT_FT_0_BEACON   (1 << 3)
 enable or disable the BEACON filter
 
#define CC2538_ACCEPT_FT_1_DATA   (1 << 4)
 enable or disable the DATA filter
 
#define CC2538_ACCEPT_FT_2_ACK   (1 << 5)
 enable or disable the ACK filter
 
#define CC2538_ACCEPT_FT_3_CMD   (1 << 6)
 enable or disable the CMD filter
 
#define CC2538_STATE_SFD_WAIT_RANGE_MIN   (0x03U)
 min range value of SFD wait state
 
#define CC2538_STATE_SFD_WAIT_RANGE_MAX   (0x06U)
 max range value of SFD wait state
 
#define CC2538_FRMCTRL1_PENDING_OR_MASK   (0x04)
 mask for enabling or disabling the frame pending bit
 
#define CC2538_FRMCTRL0_RX_MODE_DIS   (0xC)
 mask for disabling RX Chain during CCA
 
#define RFCORE_ASSERT(expr)   (void)( (expr) || RFCORE_ASSERT_failure(#expr, __FUNCTION__, __LINE__) )
 
#define RFCORE_WAIT_UNTIL(expr)
 
#define RFCORE_FLUSH_RECEIVE_FIFO()   rfcore_strobe(ISFLUSHRX)
 
#define ABS_DIFF(x, y)   ( ((x) < (y))? ((y) - (x)) : ((x) - (y)) )
 
#define BOOLEAN(x)   ( (x) != 0 )
 
#define NOT(x)   ( (x) == 0 )
 
#define GET_BYTE(buffer, index)   ( (unsigned char*)(buffer) )[index]
 
#define BIT(n)   ( 1 << (n) )
 
enum  { FSM_STATE_IDLE = 0 , FSM_STATE_RX_CALIBRATION = 2 , FSM_STATE_TX_CALIBRATION = 32 }
 
enum  {
  STROBE_ERR = BIT(6) , TXUNDERF = BIT(5) , TXOVERF = BIT(4) , RXUNDERF = BIT(3) ,
  RXOVERF = BIT(2) , RXABO = BIT(1) , NLOCK = BIT(0)
}
 RFCORE_XREG_RFERRM bits. More...
 
enum  { SET_RXENMASK_ON_TX = BIT(0) , IGNORE_TX_UNDERF = BIT(1) , PENDING_OR = BIT(2) }
 RFCORE_XREG_FRMCTRL0 bits. More...
 
enum  { ENERGY_SCAN = BIT(4) , AUTOACK = BIT(5) , AUTOCRC = BIT(6) , APPEND_DATA_MODE = BIT(7) }
 RFCORE_XREG_FRMCTRL1 bits. More...
 
enum  {
  ACT_UNUSED = BIT(0) , SFD = BIT(1) , FIFOP = BIT(2) , SRC_MATCH_DONE = BIT(3) ,
  SRC_MATCH_FOUND = BIT(4) , FRAME_ACCEPTED = BIT(5) , RXPKTDONE = BIT(6) , RXMASKZERO = BIT(7)
}
 RFCORE_XREG_RFIRQM0 / RFCORE_XREG_RFIRQF0 bits. More...
 
enum  {
  TXACKDONE = BIT(0) , TXDONE = BIT(1) , RF_IDLE = BIT(2) , CSP_MANINT = BIT(3) ,
  CSP_STOP = BIT(4) , CSP_WAIT = BIT(5)
}
 RFCORE_XREG_RFIRQM1 / RFCORE_XREG_RFIRQF1 bits. More...
 
enum  { rfc_obs_sig0 = 0 , rfc_obs_sig1 = 1 , rfc_obs_sig2 = 2 }
 Values for use with CCTEST_OBSSELx registers. More...
 
enum  {
  constant_value_0 = 0x00 , constant_value_1 = 0x01 , rfc_sniff_data = 0x08 , rfc_sniff_clk = 0x09 ,
  rssi_valid = 0x0c , demod_cca = 0x0d , sampled_cca = 0x0e , sfd_sync = 0x0f ,
  tx_active = 0x10 , rx_active = 0x11 , ffctrl_fifo = 0x12 , ffctrl_fifop = 0x13 ,
  packet_done = 0x14 , rfc_xor_rand_i_q = 0x16 , rfc_rand_q = 0x17 , rfc_rand_i = 0x18 ,
  lock_status = 0x19 , pa_pd = 0x20 , lna_pd = 0x2a , disabled = 0xff
}
 Values for RFCORE_XREG_RFC_OBS_CTRLx registers. More...
 

RF CORE observable signals settings

#define CONFIG_CC2538_RF_OBS_0   tx_active
 
#define CONFIG_CC2538_RF_OBS_1   rx_active
 
#define CONFIG_CC2538_RF_OBS_2   rssi_valid
 
#define CONFIG_CC2538_RF_OBS_SIG_0_PCX   0 /* PC0 = LED_1 (red) */
 
#define CONFIG_CC2538_RF_OBS_SIG_1_PCX   1 /* PC0 = LED_2 (red) */
 
#define CONFIG_CC2538_RF_OBS_SIG_2_PCX   2 /* PC0 = LED_3 (red) */
 
void cc2538_rf_hal_setup (ieee802154_dev_t *hal)
 Setup CC2538 in order to be used with the IEEE 802.15.4 Radio HAL.
 
static void cc2538_rf_enable_irq (void)
 Enable CC2538 RF IRQs.
 
static void cc2538_rf_disable_irq (void)
 Disable CC2538 RF IRQs.
 
void cc2538_irq_handler (void)
 IRQ handler for RF events.
 
bool cc2538_channel_clear (void)
 Trigger a clear channel assessment.
 
void cc2538_get_addr_long (uint8_t *addr)
 Get the configured long address of the device.
 
void cc2538_get_addr_short (uint8_t *addr)
 Get the configured short address of the device.
 
unsigned int cc2538_get_chan (void)
 Get the configured channel number of the device.
 
bool cc2538_get_monitor (void)
 Check if device is in monitor (promiscuous) mode.
 
uint16_t cc2538_get_pan (void)
 Get the configured PAN ID of the device.
 
int cc2538_get_tx_power (void)
 Get the configured transmission power of the device.
 
void cc2538_init (void)
 Initialise the CC2538 radio hardware.
 
bool cc2538_is_on (void)
 Check if device is active.
 
void cc2538_off (void)
 Deactivate the CC2538 radio device.
 
bool cc2538_on (void)
 Activate the CC2538 radio device.
 
void cc2538_setup (cc2538_rf_t *dev)
 Setup a CC2538 radio device.
 
void cc2538_set_addr_short (const uint8_t *addr)
 Set the short address of the device.
 
void cc2538_set_addr_long (const uint8_t *addr)
 Set the long address of the device.
 
void cc2538_set_chan (unsigned int chan)
 Set the channel number of the device.
 
void cc2538_set_freq (unsigned int MHz)
 Set the frequency of the device.
 
void cc2538_set_monitor (bool mode)
 Enable/disable monitor (promiscuous) mode for the device.
 
void cc2538_set_pan (uint16_t pan)
 Set the PAN ID of the device.
 
void cc2538_set_state (cc2538_rf_t *dev, netopt_state_t state)
 Set the state of the device.
 
void cc2538_set_tx_power (int dBm)
 Set the transmission power for the device.
 

Macro Definition Documentation

◆ ABS_DIFF

#define ABS_DIFF (   x,
 
)    ( ((x) < (y))? ((y) - (x)) : ((x) - (y)) )

Definition at line 127 of file cc2538_rf.h.

◆ BIT

#define BIT (   n)    ( 1 << (n) )

Definition at line 132 of file cc2538_rf.h.

◆ BOOLEAN

#define BOOLEAN (   x)    ( (x) != 0 )

Definition at line 128 of file cc2538_rf.h.

◆ CC2538_ACCEPT_FT_0_BEACON

#define CC2538_ACCEPT_FT_0_BEACON   (1 << 3)

enable or disable the BEACON filter

Definition at line 103 of file cc2538_rf.h.

◆ CC2538_ACCEPT_FT_1_DATA

#define CC2538_ACCEPT_FT_1_DATA   (1 << 4)

enable or disable the DATA filter

Definition at line 104 of file cc2538_rf.h.

◆ CC2538_ACCEPT_FT_2_ACK

#define CC2538_ACCEPT_FT_2_ACK   (1 << 5)

enable or disable the ACK filter

Definition at line 105 of file cc2538_rf.h.

◆ CC2538_ACCEPT_FT_3_CMD

#define CC2538_ACCEPT_FT_3_CMD   (1 << 6)

enable or disable the CMD filter

Definition at line 106 of file cc2538_rf.h.

◆ CC2538_AUTOCRC_LEN

#define CC2538_AUTOCRC_LEN   (2)

Definition at line 41 of file cc2538_rf.h.

◆ CC2538_CCA_MODE_MASK

#define CC2538_CCA_MODE_MASK   (0x18)

CCA Mode mask.

Definition at line 76 of file cc2538_rf.h.

◆ CC2538_CCA_MODE_POS

#define CC2538_CCA_MODE_POS   (3U)

CCA Mode pos.

Definition at line 77 of file cc2538_rf.h.

◆ CC2538_CCA_THR_MASK

#define CC2538_CCA_THR_MASK   (0x000000FF)

CCA Threshold mask.

Definition at line 74 of file cc2538_rf.h.

◆ CC2538_CORR_VAL_MASK

#define CC2538_CORR_VAL_MASK   (0x7F)

Definition at line 70 of file cc2538_rf.h.

◆ CC2538_CORR_VAL_MAX

#define CC2538_CORR_VAL_MAX   (110U)

Definition at line 69 of file cc2538_rf.h.

◆ CC2538_CORR_VAL_MIN

#define CC2538_CORR_VAL_MIN   (50U)

Definition at line 68 of file cc2538_rf.h.

◆ CC2538_CRC_BIT_MASK

#define CC2538_CRC_BIT_MASK   (0x80)

Definition at line 72 of file cc2538_rf.h.

◆ CC2538_CSP_INCMAXY_MAX_MASK

#define CC2538_CSP_INCMAXY_MAX_MASK   (0x7)

CSP INCMAXY instruction (increment Register CSPX without exceeding CSPY)

Definition at line 96 of file cc2538_rf.h.

◆ CC2538_CSP_MCU_CTRL_MASK

#define CC2538_CSP_MCU_CTRL_MASK   (0x1)

MCU Ctrl mask.

Definition at line 93 of file cc2538_rf.h.

◆ CC2538_CSP_SKIP_COND_CCA

#define CC2538_CSP_SKIP_COND_CCA   (0x00)

CSP Skip condition is valid CCA.

Definition at line 84 of file cc2538_rf.h.

◆ CC2538_CSP_SKIP_COND_CSPZ

#define CC2538_CSP_SKIP_COND_CSPZ   (0x06)

CSP Skip condition is CSPZ is 0.

Definition at line 85 of file cc2538_rf.h.

◆ CC2538_CSP_SKIP_COND_RSSI

#define CC2538_CSP_SKIP_COND_RSSI   (0x07)

CSP Skip condition is valid RSSI.

Definition at line 86 of file cc2538_rf.h.

◆ CC2538_CSP_SKIP_INST_MASK

#define CC2538_CSP_SKIP_INST_MASK   (0x70)

CSP Skip instruction mask.

Definition at line 79 of file cc2538_rf.h.

◆ CC2538_CSP_SKIP_INST_POS

#define CC2538_CSP_SKIP_INST_POS   (4U)

CSP Skip instruction pos.

Definition at line 80 of file cc2538_rf.h.

◆ CC2538_CSP_SKIP_N_MASK

#define CC2538_CSP_SKIP_N_MASK   (0x08)

CSP Skip condition negation mask.

Definition at line 82 of file cc2538_rf.h.

◆ CC2538_FRMCTRL0_RX_MODE_DIS

#define CC2538_FRMCTRL0_RX_MODE_DIS   (0xC)

mask for disabling RX Chain during CCA

Definition at line 112 of file cc2538_rf.h.

◆ CC2538_FRMCTRL1_PENDING_OR_MASK

#define CC2538_FRMCTRL1_PENDING_OR_MASK   (0x04)

mask for enabling or disabling the frame pending bit

Definition at line 110 of file cc2538_rf.h.

◆ CC2538_MAX_FREQ

#define CC2538_MAX_FREQ   (2507)

Definition at line 59 of file cc2538_rf.h.

◆ CC2538_MCTRL_RUN_MASK

#define CC2538_MCTRL_RUN_MASK   (0x1)

Run MAC Timer.

Definition at line 91 of file cc2538_rf.h.

◆ CC2538_MCTRL_SYNC_MASK

#define CC2538_MCTRL_SYNC_MASK   (0x2)

Sync MAC Timer to external clock.

Definition at line 90 of file cc2538_rf.h.

◆ CC2538_MIN_FREQ

#define CC2538_MIN_FREQ   (2394)

Definition at line 58 of file cc2538_rf.h.

◆ CC2538_PACKET_LENGTH_SIZE

#define CC2538_PACKET_LENGTH_SIZE   (1)

Definition at line 43 of file cc2538_rf.h.

◆ CC2538_RF_CHANNEL_DEFAULT

#define CC2538_RF_CHANNEL_DEFAULT   (CONFIG_IEEE802154_DEFAULT_CHANNEL)

Definition at line 62 of file cc2538_rf.h.

◆ CC2538_RF_FIFO_SIZE

#define CC2538_RF_FIFO_SIZE   (128)

Definition at line 42 of file cc2538_rf.h.

◆ CC2538_RF_MAX_DATA_LEN

#define CC2538_RF_MAX_DATA_LEN   (CC2538_RF_FIFO_SIZE - CC2538_PACKET_LENGTH_SIZE)

Definition at line 45 of file cc2538_rf.h.

◆ CC2538_RF_POWER_DEFAULT

#define CC2538_RF_POWER_DEFAULT   (CONFIG_IEEE802154_DEFAULT_TXPOWER)

Default output power in dBm.

Definition at line 61 of file cc2538_rf.h.

◆ CC2538_RF_SENSITIVITY

#define CC2538_RF_SENSITIVITY   (-97)

dBm typical, normal conditions

Definition at line 101 of file cc2538_rf.h.

◆ CC2538_RSSI_OFFSET

#define CC2538_RSSI_OFFSET   (-73)

Signal strength offset value.

Definition at line 100 of file cc2538_rf.h.

◆ CC2538_RXENABLE_RXON_MASK

#define CC2538_RXENABLE_RXON_MASK   (0x80)

RX on mask.

Definition at line 98 of file cc2538_rf.h.

◆ CC2538_SFR_MTMSEL_MASK

#define CC2538_SFR_MTMSEL_MASK   (0x7)

MAC Timer selection mask.

Definition at line 88 of file cc2538_rf.h.

◆ CC2538_SFR_MTMSEL_TIMER_P

#define CC2538_SFR_MTMSEL_TIMER_P   (0x2)

Selects Timer period.

Definition at line 89 of file cc2538_rf.h.

◆ CC2538_STATE_SFD_WAIT_RANGE_MAX

#define CC2538_STATE_SFD_WAIT_RANGE_MAX   (0x06U)

max range value of SFD wait state

Definition at line 108 of file cc2538_rf.h.

◆ CC2538_STATE_SFD_WAIT_RANGE_MIN

#define CC2538_STATE_SFD_WAIT_RANGE_MIN   (0x03U)

min range value of SFD wait state

Definition at line 107 of file cc2538_rf.h.

◆ CONFIG_CC2538_RF_OBS_0

#define CONFIG_CC2538_RF_OBS_0   tx_active

Definition at line 260 of file cc2538_rf.h.

◆ CONFIG_CC2538_RF_OBS_1

#define CONFIG_CC2538_RF_OBS_1   rx_active

Definition at line 263 of file cc2538_rf.h.

◆ CONFIG_CC2538_RF_OBS_2

#define CONFIG_CC2538_RF_OBS_2   rssi_valid

Definition at line 266 of file cc2538_rf.h.

◆ CONFIG_CC2538_RF_OBS_SIG_0_PCX

#define CONFIG_CC2538_RF_OBS_SIG_0_PCX   0 /* PC0 = LED_1 (red) */

Definition at line 271 of file cc2538_rf.h.

◆ CONFIG_CC2538_RF_OBS_SIG_1_PCX

#define CONFIG_CC2538_RF_OBS_SIG_1_PCX   1 /* PC0 = LED_2 (red) */

Definition at line 274 of file cc2538_rf.h.

◆ CONFIG_CC2538_RF_OBS_SIG_2_PCX

#define CONFIG_CC2538_RF_OBS_SIG_2_PCX   2 /* PC0 = LED_3 (red) */

Definition at line 277 of file cc2538_rf.h.

◆ GET_BYTE

#define GET_BYTE (   buffer,
  index 
)    ( (unsigned char*)(buffer) )[index]

Definition at line 130 of file cc2538_rf.h.

◆ IEEE802154_CHAN2FREQ

#define IEEE802154_CHAN2FREQ (   chan)    ( IEEE802154_MIN_FREQ + ((chan) - IEEE802154_CHANNEL_MIN) * IEEE802154_CHANNEL_SPACING )

Definition at line 54 of file cc2538_rf.h.

◆ IEEE802154_CHANNEL_SPACING

#define IEEE802154_CHANNEL_SPACING   (5)

Channel spacing in MHz

Definition at line 52 of file cc2538_rf.h.

◆ IEEE802154_FREQ2CHAN

#define IEEE802154_FREQ2CHAN (   freq)    ( IEEE802154_CHANNEL_MIN + ((freq) - IEEE802154_MIN_FREQ) / IEEE802154_CHANNEL_SPACING )

Definition at line 55 of file cc2538_rf.h.

◆ IEEE802154_MAX_FREQ

#define IEEE802154_MAX_FREQ   (2480)

Max.

frequency (2480 MHz)

Definition at line 50 of file cc2538_rf.h.

◆ IEEE802154_MIN_FREQ

#define IEEE802154_MIN_FREQ   (2405)

Min.

frequency (2405 MHz)

Definition at line 49 of file cc2538_rf.h.

◆ NOT

#define NOT (   x)    ( (x) == 0 )

Definition at line 129 of file cc2538_rf.h.

◆ NUM_POWER_LEVELS

#define NUM_POWER_LEVELS   ( OUTPUT_POWER_MAX - OUTPUT_POWER_MIN + 1 )

Definition at line 66 of file cc2538_rf.h.

◆ OUTPUT_POWER_MAX

#define OUTPUT_POWER_MAX   (7)

Max output power in dBm.

Definition at line 65 of file cc2538_rf.h.

◆ OUTPUT_POWER_MIN

#define OUTPUT_POWER_MIN   (-24)

Min output power in dBm.

Definition at line 64 of file cc2538_rf.h.

◆ RFCORE_ASSERT

#define RFCORE_ASSERT (   expr)    (void)( (expr) || RFCORE_ASSERT_failure(#expr, __FUNCTION__, __LINE__) )

Definition at line 114 of file cc2538_rf.h.

◆ RFCORE_FLUSH_RECEIVE_FIFO

#define RFCORE_FLUSH_RECEIVE_FIFO ( )    rfcore_strobe(ISFLUSHRX)

Definition at line 125 of file cc2538_rf.h.

◆ RFCORE_WAIT_UNTIL

#define RFCORE_WAIT_UNTIL (   expr)
Value:
while (!(expr)) { \
DEBUG("RFCORE_WAIT_UNTIL(%s) at line %u in %s()\n", #expr, __LINE__, __FUNCTION__); \
thread_yield(); \
}

Definition at line 117 of file cc2538_rf.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 134 of file cc2538_rf.h.

◆ anonymous enum

anonymous enum

RFCORE_XREG_RFERRM bits.

Definition at line 143 of file cc2538_rf.h.

◆ anonymous enum

anonymous enum

RFCORE_XREG_FRMCTRL0 bits.

Definition at line 156 of file cc2538_rf.h.

◆ anonymous enum

anonymous enum

RFCORE_XREG_FRMCTRL1 bits.

Definition at line 165 of file cc2538_rf.h.

◆ anonymous enum

anonymous enum

RFCORE_XREG_RFIRQM0 / RFCORE_XREG_RFIRQF0 bits.

Enumerator
SFD 

Start of frame event.

RXPKTDONE 

End of frame event.

Definition at line 175 of file cc2538_rf.h.

◆ anonymous enum

anonymous enum

RFCORE_XREG_RFIRQM1 / RFCORE_XREG_RFIRQF1 bits.

Definition at line 189 of file cc2538_rf.h.

◆ anonymous enum

anonymous enum

Values for use with CCTEST_OBSSELx registers.

Definition at line 201 of file cc2538_rf.h.

◆ anonymous enum

anonymous enum

Values for RFCORE_XREG_RFC_OBS_CTRLx registers.

Enumerator
constant_value_0 

Constant value 0.

constant_value_1 

Constant value 1.

rfc_sniff_data 

Data from packet sniffer.

Sample data on rising edges of sniff_clk.

rfc_sniff_clk 

250kHz clock for packet sniffer data.

rssi_valid 

Pin is high when the RSSI value has been updated at least once since RX was started.

Cleared when leaving RX.

demod_cca 

Clear channel assessment.

See FSMSTAT1 register for details on how to configure the behavior of this signal.

sampled_cca 

A sampled version of the CCA bit from demodulator.

The value is updated whenever a SSAMPLECCA or STXONCCA strobe is issued.

sfd_sync 

Pin is high when a SFD has been received or transmitted.

Cleared when leaving RX/TX respectively. Not to be confused with the SFD exception.

tx_active 

Indicates that FFCTRL is in one of the TX states.

Active-high.

rx_active 

Indicates that FFCTRL is in one of the RX states.

Active-high.

ffctrl_fifo 

Pin is high when one or more bytes are in the RXFIFO.

Low during RXFIFO overflow.

ffctrl_fifop 

Pin is high when the number of bytes in the RXFIFO exceeds the programmable threshold or at least one complete frame is in the RXFIFO.

Also highduring RXFIFO overflow. Not to be confused with the FIFOP exception.

packet_done 

A complete frame has been received.

I.e., the number of bytes set by the frame-length field has been received.

rfc_xor_rand_i_q 

XOR between I and Q random outputs.

Updated at 8 MHz.

rfc_rand_q 

Random data output from the Q channel of the receiver.

Updated at 8 MHz.

rfc_rand_i 

Random data output from the I channel of the receiver.

Updated at 8 MHz

lock_status 

1 when PLL is in lock, otherwise 0

pa_pd 

Power amplifier power-down signal.

lna_pd 

LNA power-down signal.

disabled 

disabled

Definition at line 210 of file cc2538_rf.h.

Function Documentation

◆ cc2538_channel_clear()

bool cc2538_channel_clear ( void  )

Trigger a clear channel assessment.

Returns
True if channel is clear
False if channel is busy

◆ cc2538_get_addr_long()

void cc2538_get_addr_long ( uint8_t *  addr)

Get the configured long address of the device.

Parameters
[out]addrThe currently set (8-byte) long address

◆ cc2538_get_addr_short()

void cc2538_get_addr_short ( uint8_t *  addr)

Get the configured short address of the device.

Parameters
[out]addrThe currently set (2-byte) short address

◆ cc2538_get_chan()

unsigned int cc2538_get_chan ( void  )

Get the configured channel number of the device.

Returns
The currently set channel number

◆ cc2538_get_monitor()

bool cc2538_get_monitor ( void  )

Check if device is in monitor (promiscuous) mode.

Returns
True if device is in monitor mode
False if device is not in monitor mode

◆ cc2538_get_pan()

uint16_t cc2538_get_pan ( void  )

Get the configured PAN ID of the device.

Returns
The currently set PAN ID

◆ cc2538_get_tx_power()

int cc2538_get_tx_power ( void  )

Get the configured transmission power of the device.

Returns
The currently configured transmission power in dBm

◆ cc2538_is_on()

bool cc2538_is_on ( void  )

Check if device is active.

Returns
True if device is active
False if device is not active

◆ cc2538_rf_disable_irq()

static void cc2538_rf_disable_irq ( void  )
inlinestatic

Disable CC2538 RF IRQs.

Definition at line 313 of file cc2538_rf.h.

◆ cc2538_rf_enable_irq()

static void cc2538_rf_enable_irq ( void  )
inlinestatic

Enable CC2538 RF IRQs.

Definition at line 304 of file cc2538_rf.h.

◆ cc2538_rf_hal_setup()

void cc2538_rf_hal_setup ( ieee802154_dev_t hal)

Setup CC2538 in order to be used with the IEEE 802.15.4 Radio HAL.

Note
This functions MUST be called before cc2538_init.
Parameters
[in]halpointer to the HAL descriptor associated to the device.

◆ cc2538_set_addr_long()

void cc2538_set_addr_long ( const uint8_t *  addr)

Set the long address of the device.

Parameters
[in]addr(8-byte) short address to set

◆ cc2538_set_addr_short()

void cc2538_set_addr_short ( const uint8_t *  addr)

Set the short address of the device.

Parameters
[in]addr(2-byte) short address to set

◆ cc2538_set_chan()

void cc2538_set_chan ( unsigned int  chan)

Set the channel number of the device.

Parameters
[in]chanChannel number to set

◆ cc2538_set_freq()

void cc2538_set_freq ( unsigned int  MHz)

Set the frequency of the device.

Parameters
[in]MHzFrequency to set in MHz

◆ cc2538_set_monitor()

void cc2538_set_monitor ( bool  mode)

Enable/disable monitor (promiscuous) mode for the device.

Parameters
[in]modeTrue for enable, false for disable

◆ cc2538_set_pan()

void cc2538_set_pan ( uint16_t  pan)

Set the PAN ID of the device.

Parameters
[in]panPAN ID to set

◆ cc2538_set_state()

void cc2538_set_state ( cc2538_rf_t dev,
netopt_state_t  state 
)

Set the state of the device.

Parameters
[out]devDevice descriptor
[in]stateState to set device to

◆ cc2538_set_tx_power()

void cc2538_set_tx_power ( int  dBm)

Set the transmission power for the device.

Parameters
[in]dBmTransmission power to set in dBm

◆ cc2538_setup()

void cc2538_setup ( cc2538_rf_t dev)

Setup a CC2538 radio device.

Parameters
[out]devDevice descriptor