cc2538_rfcore.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Loci Controls Inc.
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
23 #include "cc2538.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 typedef struct {
55  cc2538_reg_t RESERVED1[10];
57  union {
59  struct {
60  cc2538_reg_t FRAME_FILTER_EN : 1;
61  cc2538_reg_t PAN_COORDINATOR : 1;
62  cc2538_reg_t MAX_FRAME_VERSION: 2;
64  } XREG_FRMFILT0bits;
65  };
66 
76  union {
78  struct {
79  cc2538_reg_t TX_MODE : 2;
80  cc2538_reg_t RX_MODE : 2;
81  cc2538_reg_t ENERGY_SCAN : 1;
82  cc2538_reg_t AUTOACK : 1;
83  cc2538_reg_t AUTOCRC : 1;
84  cc2538_reg_t APPEND_DATA_MODE : 1;
85  cc2538_reg_t RESERVED : 24;
86  } XREG_FRMCTRL0bits;
87  };
88 
98  union {
100  struct {
101  cc2538_reg_t FSM_FFCTRL_STATE : 6;
102  cc2538_reg_t CAL_RUNNING : 1;
103  cc2538_reg_t CAL_DONE : 1;
104  cc2538_reg_t RESERVED : 24;
105  } XREG_FSMSTAT0bits;
106  };
107 
108  union {
110  struct {
111  cc2538_reg_t RX_ACTIVE : 1;
112  cc2538_reg_t TX_ACTIVE : 1;
113  cc2538_reg_t LOCK_STATUS : 1;
114  cc2538_reg_t SAMPLED_CCA : 1;
115  cc2538_reg_t CCA : 1;
116  cc2538_reg_t SFD : 1;
117  cc2538_reg_t FIFOP : 1;
118  cc2538_reg_t FIFO : 1;
119  cc2538_reg_t RESERVED : 24;
120  } XREG_FSMSTAT1bits;
121  };
122 
132  union {
134  struct {
136  cc2538_reg_t RESERVED : 31;
137  } XREG_RSSISTATbits;
138  };
139 
157  union {
159  struct {
162  cc2538_reg_t RESERVED : 30;
163  } XREG_RFRNDbits;
164  };
165 
190  cc2538_reg_t RESERVED4[32];
197  cc2538_reg_t RESERVED5[5];
201  cc2538_reg_t RESERVED6[12];
203  cc2538_reg_t RESERVED7[5];
220 
221 #define RFCORE ( (cc2538_rfcore_t*)0x40088580 )
224 enum {
225  DECZ = 0xc5,
226  DECY = 0xc4,
227  DECX = 0xc3,
228  INCZ = 0xc2,
229  INCY = 0xc1,
230  INCX = 0xc0,
231  INCMAXY = 0xc8,
232  RANDXY = 0xbd,
233  INT = 0xba,
234  WAITX = 0xbc,
235  SETCMP1 = 0xbe,
236  WAIT_W = 0x80,
237  WEVENT1 = 0xb8,
238  WEVENT2 = 0xb9,
239  LABEL = 0xbb,
240  RPT_C = 0xa0,
241  SKIP_S_C = 0x00,
242  STOP = 0xd2,
243  SNOP = 0xd0,
244  SRXON = 0xd3,
245  STXON = 0xd9,
246  STXONCCA = 0xda,
247  SSAMPLECCA = 0xdb,
248  SRFOFF = 0xdf,
249  SFLUSHRX = 0xdd,
250  SFLUSHTX = 0xde,
251  SACK = 0xd6,
252  SACKPEND = 0xd7,
253  SNACK = 0xd8,
254  SRXMASKBITSET = 0xd4,
255  SRXMASKBITCLR = 0xd5,
256  ISSTOP = 0xe2,
257  ISSTART = 0xe1,
258  ISRXON = 0xe3,
259  ISRXMASKBITSET = 0xe4,
260  ISRXMASKBITCLR = 0xe5,
261  ISTXON = 0xe9,
262  ISTXONCCA = 0xea,
263  ISSAMPLECCA = 0xeb,
264  ISRFOFF = 0xef,
265  ISFLUSHRX = 0xed,
266  ISFLUSHTX = 0xee,
267  ISACK = 0xe6,
268  ISACKPEND = 0xe7,
269  ISNACK = 0xe8,
270  ISCLEAR = 0xff,
271 };
272 
273 #ifdef __cplusplus
274 } /* extern "C" */
275 #endif
276 
CC2538 MCU interrupt and register definitions.
volatile uint32_t cc2538_reg_t
Least-significant 32 bits of the IEEE address.
Definition: cc2538.h:123
@ SFD
Start of frame event.
Definition: cc2538_rf.h:177
@ SNOP
No operation.
@ LABEL
Set loop label.
@ SFLUSHRX
Flush RX FIFO buffer and reset demodulator.
@ INCX
Increment X.
@ SKIP_S_C
Conditional skip instruction | S | N | C.
@ SACKPEND
Send acknowledge frame with the pending field set.
@ WEVENT2
Wait until MAC timer event 2.
@ WAIT_W
Wait for W MAC timer overflows | W (W = 0-31)
@ INCY
Increment Y.
@ ISCLEAR
Clear CSP program memory, reset program counter.
@ RPT_C
Conditional repeat | N | C (N = 0, 8; C = 0-7)
@ ISRXMASKBITCLR
Clear bit in RXENABLE.
@ SNACK
Abort sending of acknowledge frame.
@ ISFLUSHTX
Flush TX FIFO buffer.
@ ISSTOP
Stop program execution.
@ ISRXON
Enable and calibrate frequency synthesizer for RX.
@ SRXON
Enable and calibrate frequency synthesizer for RX.
@ STXONCCA
Enable calibration and TX if CCA indicates a clear channel.
@ DECX
Decrement X.
@ STOP
Stop program execution.
@ SACK
Send acknowledge frame with pending field cleared.
@ ISTXONCCA
Enable calibration and TX if CCA indicates a clear channel.
@ ISSAMPLECCA
Sample the current CCA value to SAMPLED_CCA.
@ DECZ
Decrement Z.
@ SRXMASKBITCLR
Clear bit in RXENABLE register.
@ ISACK
Send acknowledge frame with the pending field cleared.
@ DECY
Decrement Y.
@ SETCMP1
Set the compare value of the MAC timer to the current timer value.
@ WAITX
Wait for X MAC timer overflows.
@ ISTXON
Enable TX after calibration.
@ INCMAXY
Increment Y not greater than M.
@ SRXMASKBITSET
Set bit in RXENABLE register.
@ ISFLUSHRX
Flush RX FIFO buffer and reset demodulator.
@ SRFOFF
Disable RX or TX and frequency synthesizer.
@ RANDXY
Load random value into X.
@ ISACKPEND
Send acknowledge frame with the pending field set.
@ ISRFOFF
Disable RX or TX, and the frequency synthesizer.
@ STXON
Enable TX after calibration.
@ ISSTART
Start program execution.
@ INCZ
Increment Z.
@ WEVENT1
Wait until MAC timer event 1.
@ ISRXMASKBITSET
Set bit in RXENABLE.
@ SFLUSHTX
Flush TX FIFO buffer.
@ SSAMPLECCA
Sample the current CCA value to SAMPLED_CCA.
@ ISNACK
Abort sending of acknowledge frame.
@ INT
Interrupt.
RF Core component registers.
Definition: cc2538_rfcore.h:32
cc2538_reg_t XREG_FSMSTAT0
RF Radio status register.
Definition: cc2538_rfcore.h:99
cc2538_reg_t SFR_MTMOVF0
RF MAC Timer multiplexed overflow register 0.
cc2538_reg_t SFR_MTMSEL
RF MAC Timer multiplex select.
cc2538_reg_t FFSM_SRCRESMASK2
RF Source address matching result.
Definition: cc2538_rfcore.h:35
cc2538_reg_t SFR_MTMOVF1
RF MAC Timer multiplexed overflow register 1.
cc2538_reg_t XREG_CSPT
RF CSP T data register.
cc2538_reg_t XREG_AGCCTRL1
RF AGC reference level.
cc2538_reg_t FFSM_PAN_ID0
RF Local address information.
Definition: cc2538_rfcore.h:51
cc2538_reg_t FFSM_SRCRESINDEX
RF Source address matching result.
Definition: cc2538_rfcore.h:36
cc2538_reg_t XREG_FSCAL3
RF Tune frequency calibration.
cc2538_reg_t XREG_FREQEST
RF Estimated RF frequency offset.
cc2538_reg_t XREG_FRMFILT1
RF Frame Filter 1.
Definition: cc2538_rfcore.h:67
cc2538_reg_t FFSM_EXT_ADDR0
RF Local address information.
Definition: cc2538_rfcore.h:43
cc2538_reg_t XREG_RFC_OBS_CTRL1
RF observation mux control.
cc2538_reg_t XREG_CSPCTRL
RF CSP control bit.
cc2538_reg_t FFSM_SRCRESMASK0
RF Source address matching result.
Definition: cc2538_rfcore.h:33
cc2538_reg_t XREG_ATEST
RF Analog test control.
cc2538_reg_t FFSM_SRCEXTPENDEN1
RF Source address matching control.
Definition: cc2538_rfcore.h:38
cc2538_reg_t XREG_RFIRQM0
RF interrupt masks.
cc2538_reg_t FFSM_SRCSHORTPENDEN0
RF Source address matching control.
Definition: cc2538_rfcore.h:40
cc2538_reg_t SFR_MTM1
RF MAC Timer multiplexed register 1.
cc2538_reg_t XREG_RXMASKSET
RF RX enabling.
Definition: cc2538_rfcore.h:91
cc2538_reg_t XREG_RXFIRST
RF First byte in RX FIFO.
cc2538_reg_t XREG_RXCTRL
RF Tune receive section.
cc2538_reg_t SFR_MTM0
RF MAC Timer multiplexed register 0.
cc2538_reg_t XREG_CSPY
RF CSP Y data register.
cc2538_reg_t XREG_CCACTRL1
RF Other CCA Options.
cc2538_reg_t XREG_SRCSHORTEN1
RF Short address matching.
Definition: cc2538_rfcore.h:70
cc2538_reg_t SFR_MTIRQM
RF MAC Timer interrupt mask.
cc2538_reg_t XREG_FRMCTRL0
RF Frame handling.
Definition: cc2538_rfcore.h:77
cc2538_reg_t XREG_RFIRQM1
RF interrupt masks.
cc2538_reg_t XREG_FSMSTAT1
RF Radio status register.
cc2538_reg_t XREG_RXENABLE
RF RX enabling.
Definition: cc2538_rfcore.h:90
cc2538_reg_t XREG_FIFOPCTRL
RF FIFOP threshold.
cc2538_reg_t XREG_RFC_OBS_CTRL2
RF observation mux control.
cc2538_reg_t XREG_FSCAL1
RF Tune frequency calibration.
cc2538_reg_t FFSM_EXT_ADDR1
RF Local address information.
Definition: cc2538_rfcore.h:44
cc2538_reg_t FFSM_SRCEXTPENDEN2
RF Source address matching control.
Definition: cc2538_rfcore.h:39
cc2538_reg_t XREG_RXFIRST_PTR
RF RX FIFO pointer.
cc2538_reg_t RESERVED2
Reserved bytes.
cc2538_reg_t QRND
Random bit from the Q channel of the receiver.
cc2538_reg_t FFSM_EXT_ADDR2
RF Local address information.
Definition: cc2538_rfcore.h:45
cc2538_reg_t XREG_SRCEXTEN2
RF Extended address matching.
Definition: cc2538_rfcore.h:74
cc2538_reg_t XREG_RSSISTAT
RF RSSI valid status register.
cc2538_reg_t XREG_FRMFILT0
RF Frame Filter 0.
Definition: cc2538_rfcore.h:58
cc2538_reg_t XREG_TXFIFOCNT
RF Number of bytes in TX FIFO.
cc2538_reg_t XREG_FREQTUNE
RF Crystal oscillator frequency tuning.
Definition: cc2538_rfcore.h:93
cc2538_reg_t XREG_TXLAST_PTR
RF TX FIFO pointer.
cc2538_reg_t XREG_FRMCTRL1
RF Frame handling.
Definition: cc2538_rfcore.h:89
cc2538_reg_t XREG_RXMASKCLR
RF RX disabling.
Definition: cc2538_rfcore.h:92
cc2538_reg_t FFSM_SRCRESMASK1
RF Source address matching result.
Definition: cc2538_rfcore.h:34
cc2538_reg_t XREG_SRCEXTEN1
RF Extended address matching.
Definition: cc2538_rfcore.h:73
cc2538_reg_t XREG_CSPZ
RF CSP Z data register.
cc2538_reg_t FFSM_EXT_ADDR5
RF Local address information.
Definition: cc2538_rfcore.h:48
cc2538_reg_t XREG_CSPX
RF CSP X data register.
cc2538_reg_t SFR_MTCSPCFG
RF MAC Timer event configuration.
cc2538_reg_t XREG_TXPOWER
RF Controls the output power.
Definition: cc2538_rfcore.h:95
cc2538_reg_t XREG_PTEST1
RF Override power-down register.
cc2538_reg_t XREG_TXFILTCFG
RF TX filter configuration.
cc2538_reg_t XREG_MDMCTRL1
RF Controls modem.
cc2538_reg_t FFSM_PAN_ID1
RF Local address information.
Definition: cc2538_rfcore.h:52
cc2538_reg_t XREG_MDMTEST1
RF Test Register for Modem.
cc2538_reg_t XREG_AGCCTRL2
RF AGC gain override.
cc2538_reg_t XREG_DACTEST1
RF DAC override value.
cc2538_reg_t XREG_SRCEXTEN0
RF Extended address matching.
Definition: cc2538_rfcore.h:72
cc2538_reg_t XREG_ADCTEST2
RF ADC tuning.
cc2538_reg_t XREG_AGCCTRL0
RF AGC dynamic range control.
cc2538_reg_t FFSM_SRCEXTPENDEN0
RF Source address matching control.
Definition: cc2538_rfcore.h:37
cc2538_reg_t XREG_RXP1_PTR
RF RX FIFO pointer.
cc2538_reg_t XREG_ADCTEST0
RF ADC tuning.
cc2538_reg_t FFSM_EXT_ADDR4
RF Local address information.
Definition: cc2538_rfcore.h:47
cc2538_reg_t XREG_RFC_OBS_CTRL0
RF observation mux control.
cc2538_reg_t XREG_RFERRM
RF error interrupt mask.
cc2538_reg_t XREG_FSCAL2
RF Tune frequency calibration.
cc2538_reg_t XREG_CSPSTAT
RF CSP status register.
cc2538_reg_t XREG_FSCTRL
RF Tune frequency synthesizer.
cc2538_reg_t XREG_DACTEST2
RF DAC test setting.
cc2538_reg_t FFSM_EXT_ADDR6
RF Local address information.
Definition: cc2538_rfcore.h:49
cc2538_reg_t XREG_SRCSHORTEN0
RF Short address matching.
Definition: cc2538_rfcore.h:69
cc2538_reg_t RESERVED3
Reserved bytes.
cc2538_reg_t XREG_RXLAST_PTR
RF RX FIFO pointer.
cc2538_reg_t XREG_ADCTEST1
RF ADC tuning.
cc2538_reg_t SFR_RFDATA
RF Tx/Rx FIFO.
cc2538_reg_t XREG_FSMCTRL
RF FSM options.
cc2538_reg_t XREG_SRCSHORTEN2
RF Short address matching.
Definition: cc2538_rfcore.h:71
cc2538_reg_t XREG_DACTEST0
RF DAC override value.
cc2538_reg_t SFR_RFST
RF CSMA-CA/strobe processor.
cc2538_reg_t FFSM_EXT_ADDR3
RF Local address information.
Definition: cc2538_rfcore.h:46
cc2538_reg_t FFSM_SHORT_ADDR1
RF Local address information.
Definition: cc2538_rfcore.h:54
cc2538_reg_t XREG_CCACTRL0
RF CCA threshold.
cc2538_reg_t XREG_MDMCTRL0
RF Controls modem.
cc2538_reg_t XREG_RXFIFOCNT
RF Number of bytes in RX FIFO.
cc2538_reg_t RESERVED
Reserved bits.
Definition: cc2538_rfcore.h:63
cc2538_reg_t XREG_RFRND
RF Random data.
cc2538_reg_t FFSM_EXT_ADDR7
RF Local address information.
Definition: cc2538_rfcore.h:50
cc2538_reg_t FFSM_SRCSHORTPENDEN1
RF Source address matching control.
Definition: cc2538_rfcore.h:41
cc2538_reg_t SFR_RFERRF
RF error interrupt flags.
cc2538_reg_t FFSM_SRCSHORTPENDEN2
RF Source address matching control.
Definition: cc2538_rfcore.h:42
cc2538_reg_t IRND
Random bit from the I channel of the receiver.
cc2538_reg_t XREG_TXCTRL
RF Controls the TX settings.
Definition: cc2538_rfcore.h:96
cc2538_reg_t XREG_FSCAL0
RF Tune frequency calibration.
cc2538_reg_t XREG_SRCMATCH
RF Source address matching and pending bits.
Definition: cc2538_rfcore.h:68
cc2538_reg_t XREG_PTEST0
RF Override power-down register.
cc2538_reg_t SFR_MTIRQF
RF MAC Timer interrupt flags.
cc2538_reg_t SFR_RFIRQF1
RF interrupt flags.
cc2538_reg_t XREG_MDMTEST0
RF Test register for modem.
cc2538_reg_t XREG_FREQCTRL
RF Controls the RF frequency.
Definition: cc2538_rfcore.h:94
cc2538_reg_t SFR_RFIRQF0
RF interrupt flags.
cc2538_reg_t XREG_TXFIRST_PTR
RF TX FIFO pointer.
cc2538_reg_t XREG_RSSI
RF RSSI status register.
cc2538_reg_t XREG_AGCCTRL3
RF AGC control.
cc2538_reg_t SFR_MTCTRL
RF MAC Timer control register.
cc2538_reg_t SFR_MTMOVF2
RF MAC Timer multiplexed overflow register 2.
cc2538_reg_t FFSM_SHORT_ADDR0
RF Local address information.
Definition: cc2538_rfcore.h:53
cc2538_reg_t RSSI_VALID
RSSI value is valid.