rflib
rf_ieee_cmd.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: rf_ieee_cmd.h
3 *
4 * Description: CC13x2/CC26x2 API for IEEE 802.15.4 commands
5 *
6 * Copyright (c) 2015 - 2020, Texas Instruments Incorporated
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1) Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2) Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36 
37 #ifndef __IEEE_CMD_H
38 #define __IEEE_CMD_H
39 
40 #ifndef __RFC_STRUCT
41 #define __RFC_STRUCT
42 #endif
43 
44 #ifndef __RFC_STRUCT_ATTR
45 #if defined(__GNUC__)
46 #define __RFC_STRUCT_ATTR __attribute__ ((aligned (4)))
47 #elif defined(__TI_ARM__)
48 #define __RFC_STRUCT_ATTR __attribute__ ((__packed__,aligned (4)))
49 #else
50 #define __RFC_STRUCT_ATTR
51 #endif
52 #endif
53 
56 
59 
60 #include <stdint.h>
61 #include "rf_mailbox.h"
62 #include "rf_common_cmd.h"
63 
79 
82 #define CMD_IEEE_RX 0x2801
85  uint16_t commandNo;
86  uint16_t status;
87  rfc_radioOp_t *pNextOp;
91  struct {
92  uint8_t triggerType:4;
93  uint8_t bEnaCmd:1;
94  uint8_t triggerNo:2;
96  uint8_t pastTrig:1;
97  } startTrigger;
99  struct {
100  uint8_t rule:4;
101  uint8_t nSkip:4;
102  } condition;
103  uint8_t channel;
104  struct {
109  uint8_t bAutoFlushCrc:1;
110  uint8_t bAutoFlushIgn:1;
111  uint8_t bIncludePhyHdr:1;
112  uint8_t bIncludeCrc:1;
113  uint8_t bAppendRssi:1;
114  uint8_t bAppendCorrCrc:1;
115  uint8_t bAppendSrcInd:1;
116  uint8_t bAppendTimestamp:1;
117  } rxConfig;
120  struct {
121  uint16_t frameFiltEn:1;
122  uint16_t frameFiltStop:1;
124  uint16_t autoAckEn:1;
126  uint16_t slottedAckEn:1;
128  uint16_t autoPendEn:1;
130  uint16_t defaultPend:1;
132  uint16_t bPendDataReqOnly:1;
133  uint16_t bPanCoord:1;
135  uint16_t maxFrameVersion:2;
137  uint16_t fcfReservedMask:3;
138  uint16_t modifyFtFilter:2;
139  uint16_t bStrictLenFilter:1;
144  } frameFiltOpt;
146  struct {
147  uint8_t bAcceptFt0Beacon:1;
148  uint8_t bAcceptFt1Data:1;
151  uint8_t bAcceptFt2Ack:1;
154  uint8_t bAcceptFt3MacCmd:1;
157  uint8_t bAcceptFt4Reserved:1;
160  uint8_t bAcceptFt5Reserved:1;
163  uint8_t bAcceptFt6Reserved:1;
166  uint8_t bAcceptFt7Reserved:1;
169  } frameTypes;
172  struct {
173  uint8_t ccaEnEnergy:1;
174  uint8_t ccaEnCorr:1;
175  uint8_t ccaEnSync:1;
176  uint8_t ccaCorrOp:1;
177  uint8_t ccaSyncOp:1;
180  uint8_t ccaCorrThr:2;
183  } ccaOpt;
184  int8_t ccaRssiThr;
185  uint8_t __dummy0;
186  uint8_t numExtEntries;
187  uint8_t numShortEntries;
188  uint32_t* pExtEntryList;
189  uint32_t* pShortEntryList;
190  uint64_t localExtAddr;
191  uint16_t localShortAddr;
192  uint16_t localPanID;
193  uint16_t __dummy1;
194  uint8_t __dummy2;
195  struct {
196  uint8_t triggerType:4;
197  uint8_t bEnaCmd:1;
198  uint8_t triggerNo:2;
200  uint8_t pastTrig:1;
201  } endTrigger;
206 
208 
211 #define CMD_IEEE_ED_SCAN 0x2802
214  uint16_t commandNo;
215  uint16_t status;
216  rfc_radioOp_t *pNextOp;
220  struct {
221  uint8_t triggerType:4;
222  uint8_t bEnaCmd:1;
223  uint8_t triggerNo:2;
225  uint8_t pastTrig:1;
226  } startTrigger;
228  struct {
229  uint8_t rule:4;
230  uint8_t nSkip:4;
231  } condition;
232  uint8_t channel;
233  struct {
238  uint8_t ccaEnEnergy:1;
239  uint8_t ccaEnCorr:1;
240  uint8_t ccaEnSync:1;
241  uint8_t ccaCorrOp:1;
242  uint8_t ccaSyncOp:1;
245  uint8_t ccaCorrThr:2;
248  } ccaOpt;
249  int8_t ccaRssiThr;
250  uint8_t __dummy0;
251  int8_t maxRssi;
252  struct {
253  uint8_t triggerType:4;
254  uint8_t bEnaCmd:1;
255  uint8_t triggerNo:2;
257  uint8_t pastTrig:1;
258  } endTrigger;
263 
265 
268 #define CMD_IEEE_TX 0x2C01
271  uint16_t commandNo;
272  uint16_t status;
273  rfc_radioOp_t *pNextOp;
277  struct {
278  uint8_t triggerType:4;
279  uint8_t bEnaCmd:1;
280  uint8_t triggerNo:2;
282  uint8_t pastTrig:1;
283  } startTrigger;
285  struct {
286  uint8_t rule:4;
287  uint8_t nSkip:4;
288  } condition;
289  struct {
290  uint8_t bIncludePhyHdr:1;
291  uint8_t bIncludeCrc:1;
293  uint8_t :1;
295  uint8_t payloadLenMsb:5;
296  } txOpt;
298  uint8_t payloadLen;
299  uint8_t* pPayload;
302 
304 
307 #define CMD_IEEE_CSMA 0x2C02
310  uint16_t commandNo;
311  uint16_t status;
312  rfc_radioOp_t *pNextOp;
316  struct {
317  uint8_t triggerType:4;
318  uint8_t bEnaCmd:1;
319  uint8_t triggerNo:2;
321  uint8_t pastTrig:1;
322  } startTrigger;
324  struct {
325  uint8_t rule:4;
326  uint8_t nSkip:4;
327  } condition;
328  uint16_t randomState;
329  uint8_t macMaxBE;
331  struct {
332  uint8_t initCW:5;
333  uint8_t bSlotted:1;
334  uint8_t rxOffMode:2;
336  } csmaConfig;
341  uint8_t NB;
342  uint8_t BE;
344  int8_t lastRssi;
345  struct {
346  uint8_t triggerType:4;
347  uint8_t bEnaCmd:1;
348  uint8_t triggerNo:2;
350  uint8_t pastTrig:1;
351  } endTrigger;
357 
359 
362 #define CMD_IEEE_RX_ACK 0x2C03
365  uint16_t commandNo;
366  uint16_t status;
367  rfc_radioOp_t *pNextOp;
371  struct {
372  uint8_t triggerType:4;
373  uint8_t bEnaCmd:1;
374  uint8_t triggerNo:2;
376  uint8_t pastTrig:1;
377  } startTrigger;
379  struct {
380  uint8_t rule:4;
381  uint8_t nSkip:4;
382  } condition;
383  uint8_t seqNo;
384  struct {
385  uint8_t triggerType:4;
386  uint8_t bEnaCmd:1;
387  uint8_t triggerNo:2;
389  uint8_t pastTrig:1;
390  } endTrigger;
395 
397 
400 #define CMD_IEEE_ABORT_BG 0x2C04
403  uint16_t commandNo;
404  uint16_t status;
405  rfc_radioOp_t *pNextOp;
409  struct {
410  uint8_t triggerType:4;
411  uint8_t bEnaCmd:1;
412  uint8_t triggerNo:2;
414  uint8_t pastTrig:1;
415  } startTrigger;
417  struct {
418  uint8_t rule:4;
419  uint8_t nSkip:4;
420  } condition;
422 
424 
427 #define CMD_IEEE_MOD_CCA 0x2001
430  uint16_t commandNo;
431  struct {
432  uint8_t ccaEnEnergy:1;
433  uint8_t ccaEnCorr:1;
434  uint8_t ccaEnSync:1;
435  uint8_t ccaCorrOp:1;
436  uint8_t ccaSyncOp:1;
439  uint8_t ccaCorrThr:2;
442  } newCcaOpt;
443  int8_t newCcaRssiThr;
445 
447 
450 #define CMD_IEEE_MOD_FILT 0x2002
453  uint16_t commandNo;
454  struct {
455  uint16_t frameFiltEn:1;
456  uint16_t frameFiltStop:1;
458  uint16_t autoAckEn:1;
460  uint16_t slottedAckEn:1;
462  uint16_t autoPendEn:1;
464  uint16_t defaultPend:1;
466  uint16_t bPendDataReqOnly:1;
467  uint16_t bPanCoord:1;
469  uint16_t maxFrameVersion:2;
471  uint16_t fcfReservedMask:3;
472  uint16_t modifyFtFilter:2;
473  uint16_t bStrictLenFilter:1;
478  } newFrameFiltOpt;
480  struct {
481  uint8_t bAcceptFt0Beacon:1;
482  uint8_t bAcceptFt1Data:1;
485  uint8_t bAcceptFt2Ack:1;
488  uint8_t bAcceptFt3MacCmd:1;
491  uint8_t bAcceptFt4Reserved:1;
494  uint8_t bAcceptFt5Reserved:1;
497  uint8_t bAcceptFt6Reserved:1;
500  uint8_t bAcceptFt7Reserved:1;
503  } newFrameTypes;
507 
509 
512 #define CMD_IEEE_MOD_SRC_MATCH 0x2003
515  uint16_t commandNo;
516  struct {
517  uint8_t bEnable:1;
518  uint8_t srcPend:1;
520  uint8_t entryType:1;
521  } options;
523  uint8_t entryNo;
525 
527 
530 #define CMD_IEEE_ABORT_FG 0x2401
533  uint16_t commandNo;
535 
537 
540 #define CMD_IEEE_STOP_FG 0x2402
543  uint16_t commandNo;
545 
547 
550 #define CMD_IEEE_CCA_REQ 0x2403
553  uint16_t commandNo;
554  int8_t currentRssi;
555  int8_t maxRssi;
556  struct {
557  uint8_t ccaState:2;
558  uint8_t ccaEnergy:2;
562  uint8_t ccaCorr:2;
566  uint8_t ccaSync:1;
570  } ccaInfo;
574 
576 
580 
582  uint8_t nTxAck;
583  uint8_t nRxBeacon;
584  uint8_t nRxData;
585  uint8_t nRxAck;
586  uint8_t nRxMacCmd;
587  uint8_t nRxReserved;
588  uint8_t nRxNok;
589  uint8_t nRxIgnored;
590  uint8_t nRxBufFull;
591  int8_t lastRssi;
592  int8_t maxRssi;
593  uint8_t __dummy0;
596 
598 
602 
604  uint16_t shortAddr;
605  uint16_t panId;
607 
609 
613 
615  struct {
616  uint8_t corr:6;
617  uint8_t bIgnore:1;
618  uint8_t bCrcErr:1;
619  } status;
621 
623 
626 #endif
uint16_t __dummy1
Definition: rf_ieee_cmd.h:193
uint8_t BE
The BE parameter from the IEEE 802.15.4 CSMA-CA algorithm.
Definition: rf_ieee_cmd.h:342
uint8_t * pPayload
Pointer to payload buffer of size payloadLen
Definition: rf_ieee_cmd.h:299
#define __RFC_STRUCT_ATTR
Definition: rf_ieee_cmd.h:50
Definition: rf_ieee_cmd.h:614
uint16_t status
An integer telling the status of the command. This value is updated by the radio CPU during operation...
Definition: rf_ieee_cmd.h:404
uint8_t remainingPeriods
The number of remaining periods from a paused backoff countdown.
Definition: rf_ieee_cmd.h:343
uint8_t channel
Channel to tune to in the start of the operation 0: Use existing channel 11–26: Use as IEEE 802...
Definition: rf_ieee_cmd.h:103
int8_t ccaRssiThr
RSSI threshold for CCA.
Definition: rf_ieee_cmd.h:249
uint8_t nRxData
Number of received data frames.
Definition: rf_ieee_cmd.h:584
uint8_t NB
The NB parameter from the IEEE 802.15.4 CSMA-CA algorithm.
Definition: rf_ieee_cmd.h:341
uint16_t commandNo
The command ID number 0x2801.
Definition: rf_ieee_cmd.h:85
int8_t maxRssi
The maximum RSSI recorded during the ED scan.
Definition: rf_ieee_cmd.h:251
uint16_t localPanID
The PAN ID of the local device.
Definition: rf_ieee_cmd.h:192
uint8_t __dummy2
Definition: rf_ieee_cmd.h:194
uint16_t status
An integer telling the status of the command. This value is updated by the radio CPU during operation...
Definition: rf_ieee_cmd.h:215
IEEE 802.15.4 Gracefully Stop Foreground Level Command.
Definition: rf_ieee_cmd.h:542
uint16_t commandNo
The command ID number 0x2C02.
Definition: rf_ieee_cmd.h:310
ratmr_t startTime
Absolute or relative start time (depending on the value of startTrigger)
Definition: rf_ieee_cmd.h:276
IEEE 802.15.4 Modify Frame Filtering Parameter Command.
Definition: rf_ieee_cmd.h:452
ratmr_t endTime
Time used together with endTrigger that causes the device to give up acknowledgement reception...
Definition: rf_ieee_cmd.h:392
IEEE 802.15.4 CSMA-CA Command.
Definition: rf_ieee_cmd.h:309
uint8_t __dummy0
Definition: rf_ieee_cmd.h:593
Definition: rf_ieee_cmd.h:581
uint8_t nRxNok
Number of received frames with CRC error.
Definition: rf_ieee_cmd.h:588
uint16_t localShortAddr
The short address of the local device.
Definition: rf_ieee_cmd.h:191
uint8_t nRxReserved
Number of received frames with reserved frame type.
Definition: rf_ieee_cmd.h:587
uint8_t nRxBufFull
Number of received frames discarded because the Rx buffer was full.
Definition: rf_ieee_cmd.h:590
IEEE 802.15.4 Abort Foreground Level Command.
Definition: rf_ieee_cmd.h:532
uint16_t commandNo
The command ID number 0x2802.
Definition: rf_ieee_cmd.h:214
ratmr_t startTime
Absolute or relative start time (depending on the value of startTrigger)
Definition: rf_ieee_cmd.h:370
uint8_t entryNo
Index of entry to enable or disable.
Definition: rf_ieee_cmd.h:523
uint16_t commandNo
The command ID number 0x2001.
Definition: rf_ieee_cmd.h:430
ratmr_t startTime
Absolute or relative start time (depending on the value of startTrigger)
Definition: rf_ieee_cmd.h:219
dataQueue_t * pRxQ
Pointer to receive queue.
Definition: rf_ieee_cmd.h:118
uint8_t macMaxCSMABackoffs
The IEEE 802.15.4 MAC parameter macMaxCSMABackoffs
Definition: rf_ieee_cmd.h:330
ratmr_t endTime
Time used together with endTrigger that causes the device to end the CSMA-CA operation.
Definition: rf_ieee_cmd.h:354
int8_t lastRssi
RSSI measured at the last CCA operation.
Definition: rf_ieee_cmd.h:344
ratmr_t lastTimeStamp
Time of the last CCA operation.
Definition: rf_ieee_cmd.h:353
uint16_t commandNo
The command ID number 0x2003.
Definition: rf_ieee_cmd.h:515
uint64_t localExtAddr
The extended address of the local device.
Definition: rf_ieee_cmd.h:190
uint16_t commandNo
The command ID number 0x2401.
Definition: rf_ieee_cmd.h:533
uint8_t macMaxBE
The IEEE 802.15.4 MAC parameter macMaxBE
Definition: rf_ieee_cmd.h:329
uint8_t payloadLen
Number of bytes in the payload.
Definition: rf_ieee_cmd.h:298
uint8_t seqNo
Sequence number to expect.
Definition: rf_ieee_cmd.h:383
uint16_t status
An integer telling the status of the command. This value is updated by the radio CPU during operation...
Definition: rf_ieee_cmd.h:272
uint16_t panId
PAN ID.
Definition: rf_ieee_cmd.h:605
Definition: rf_ieee_cmd.h:603
IEEE 802.15.4 Abort Background Level Command.
Definition: rf_ieee_cmd.h:402
uint16_t commandNo
The command ID number 0x2C01.
Definition: rf_ieee_cmd.h:271
uint16_t commandNo
The command ID number 0x2C03.
Definition: rf_ieee_cmd.h:365
int8_t currentRssi
The RSSI currently observed on the channel.
Definition: rf_ieee_cmd.h:554
int8_t newCcaRssiThr
New value of ccaRssiThr for the running background level operation.
Definition: rf_ieee_cmd.h:443
uint8_t numExtEntries
Number of extended address entries.
Definition: rf_ieee_cmd.h:186
uint16_t randomState
The state of the pseudo-random generator.
Definition: rf_ieee_cmd.h:328
uint32_t ratmr_t
Type definition for RAT.
Definition: rf_mailbox.h:57
uint8_t nRxBeacon
Number of received beacon frames.
Definition: rf_ieee_cmd.h:583
IEEE 802.15.4 Enable/Disable Source Matching Entry Command.
Definition: rf_ieee_cmd.h:514
ratmr_t startTime
Absolute or relative start time (depending on the value of startTrigger)
Definition: rf_ieee_cmd.h:90
rfc_ieeeRxOutput_t * pOutput
Pointer to output structure (NULL: Do not store results)
Definition: rf_ieee_cmd.h:119
IEEE 802.15.4 Receive Acknowledgement Command.
Definition: rf_ieee_cmd.h:364
uint8_t __dummy0
Definition: rf_ieee_cmd.h:250
IEEE 802.15.4 Modify CCA Parameter Command.
Definition: rf_ieee_cmd.h:429
uint16_t commandNo
The command ID number 0x2002.
Definition: rf_ieee_cmd.h:453
int8_t maxRssi
The maximum RSSI observed on the channel since Rx was started.
Definition: rf_ieee_cmd.h:555
int8_t ccaRssiThr
RSSI threshold for CCA.
Definition: rf_ieee_cmd.h:184
IEEE 802.15.4 CCA and RSSI Information Request Command.
Definition: rf_ieee_cmd.h:552
uint16_t commandNo
The command ID number 0x2403.
Definition: rf_ieee_cmd.h:553
uint16_t status
An integer telling the status of the command. This value is updated by the radio CPU during operation...
Definition: rf_ieee_cmd.h:366
uint8_t channel
Channel to tune to in the start of the operation 0: Use existing channel 11–26: Use as IEEE 802...
Definition: rf_ieee_cmd.h:232
uint8_t nTxAck
Total number of transmitted ACK frames.
Definition: rf_ieee_cmd.h:582
ratmr_t endTime
Time used together with endTrigger that causes the device to end the Rx operation.
Definition: rf_ieee_cmd.h:260
uint32_t * pShortEntryList
Pointer to list of short address entries.
Definition: rf_ieee_cmd.h:189
int8_t maxRssi
Highest RSSI observed in the operation.
Definition: rf_ieee_cmd.h:592
IEEE 802.15.4 Transmit Command.
Definition: rf_ieee_cmd.h:270
ratmr_t endTime
Time used together with endTrigger that causes the device to end the Rx operation.
Definition: rf_ieee_cmd.h:203
Type definition for a data queue.
Definition: rf_mailbox.h:62
uint8_t nRxMacCmd
Number of received MAC command frames.
Definition: rf_ieee_cmd.h:586
uint8_t nRxAck
Number of received acknowledgement frames.
Definition: rf_ieee_cmd.h:585
uint8_t __dummy0
Definition: rf_ieee_cmd.h:185
#define __RFC_STRUCT
Definition: rf_ieee_cmd.h:41
IEEE 802.15.4 Receive Command.
Definition: rf_ieee_cmd.h:84
uint16_t status
An integer telling the status of the command. This value is updated by the radio CPU during operation...
Definition: rf_ieee_cmd.h:311
uint32_t * pExtEntryList
Pointer to list of extended address entries.
Definition: rf_ieee_cmd.h:188
Definition: rf_common_cmd.h:122
uint8_t numShortEntries
Number of short address entries.
Definition: rf_ieee_cmd.h:187
ratmr_t startTime
Absolute or relative start time (depending on the value of startTrigger)
Definition: rf_ieee_cmd.h:408
uint16_t status
An integer telling the status of the command. This value is updated by the radio CPU during operation...
Definition: rf_ieee_cmd.h:86
IEEE 802.15.4 Energy Detect Scan Command.
Definition: rf_ieee_cmd.h:213
uint16_t shortAddr
Short address.
Definition: rf_ieee_cmd.h:604
ratmr_t startTime
Absolute or relative start time (depending on the value of startTrigger)
Definition: rf_ieee_cmd.h:315
uint16_t commandNo
The command ID number 0x2402.
Definition: rf_ieee_cmd.h:543
ratmr_t timeStamp
Time stamp of transmitted frame.
Definition: rf_ieee_cmd.h:300
int8_t lastRssi
RSSI of last received frame.
Definition: rf_ieee_cmd.h:591
ratmr_t beaconTimeStamp
Time stamp of last received beacon frame.
Definition: rf_ieee_cmd.h:594
uint16_t commandNo
The command ID number 0x2C04.
Definition: rf_ieee_cmd.h:403
uint8_t nRxIgnored
Number of frames received that are to be ignored.
Definition: rf_ieee_cmd.h:589
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale