40#ifndef NRF_802154_CONST_H_
41#define NRF_802154_CONST_H_
43#define RAW_LENGTH_OFFSET 0
44#define RAW_PAYLOAD_OFFSET 1
46#define ACK_HEADER_WITH_PENDING 0x12
47#define ACK_HEADER_WITHOUT_PENDING 0x02
49#define ACK_REQUEST_OFFSET 1
50#define ACK_REQUEST_BIT (1 << 5)
52#define ASN_IN_NONCE_BIT 0x40
54#define DEST_ADDR_TYPE_OFFSET 2
55#define DEST_ADDR_TYPE_MASK 0x0c
56#define DEST_ADDR_TYPE_EXTENDED 0x0c
57#define DEST_ADDR_TYPE_NONE 0x00
58#define DEST_ADDR_TYPE_SHORT 0x08
59#define DEST_ADDR_OFFSET 6
62#define DSN_SUPPRESS_OFFSET 2
63#define DSN_SUPPRESS_BIT 0x01
65#define FRAME_COUNTER_SUPPRESS_BIT 0x20
67#define FRAME_PENDING_OFFSET 1
68#define FRAME_PENDING_BIT (1 << 4)
70#define FRAME_TYPE_OFFSET 1
71#define FRAME_TYPE_MASK 0x07
72#define FRAME_TYPE_ACK 0x02
73#define FRAME_TYPE_BEACON 0x00
74#define FRAME_TYPE_COMMAND 0x03
75#define FRAME_TYPE_DATA 0x01
76#define FRAME_TYPE_EXTENDED 0x07
77#define FRAME_TYPE_FRAGMENT 0x06
78#define FRAME_TYPE_MULTIPURPOSE 0x05
80#define FRAME_VERSION_OFFSET 2
81#define FRAME_VERSION_MASK 0x30
82#define FRAME_VERSION_0 0x00
83#define FRAME_VERSION_1 0x10
84#define FRAME_VERSION_2 0x20
85#define FRAME_VERSION_3 0x30
87#define IE_HEADER_LENGTH_MASK 0x3f
88#define IE_PRESENT_OFFSET 2
89#define IE_PRESENT_BIT 0x02
91#define KEY_ID_MODE_0 0
92#define KEY_ID_MODE_1 1
93#define KEY_ID_MODE_2 2
94#define KEY_ID_MODE_3 3
96#define KEY_ID_MODE_MASK 0x18
97#define KEY_ID_MODE_BIT_OFFSET 3
98#define KEY_ID_MODE_0_MASK 0
99#define KEY_ID_MODE_1_MASK 0x08
100#define KEY_ID_MODE_2_MASK 0x10
101#define KEY_ID_MODE_3_MASK 0x18
103#define KEY_SRC_KEY_ID_MODE_0_SIZE 0
104#define KEY_SRC_KEY_ID_MODE_1_SIZE 0
105#define KEY_SRC_KEY_ID_MODE_2_SIZE 4
106#define KEY_SRC_KEY_ID_MODE_3_SIZE 8
108#define KEY_IDX_SIZE 1
110#define MAC_CMD_COMMAND_ID_SIZE 1
111#define MAC_CMD_ASSOC_REQ 0x01
112#define MAC_CMD_ASSOC_RESP 0x02
113#define MAC_CMD_DISASSOC_NOTIFY 0x03
114#define MAC_CMD_DATA_REQ 0x04
115#define MAC_CMD_PANID_CONFLICT 0x05
116#define MAC_CMD_ORPHAN_NOTIFY 0x06
117#define MAC_CMD_BEACON_REQ 0x07
118#define MAC_CMD_COORD_REALIGN 0x08
119#define MAC_CMD_GTS_REQUEST 0x09
121#define PAN_ID_COMPR_OFFSET 1
122#define PAN_ID_COMPR_MASK 0x40
124#define PAN_ID_OFFSET 4
127#define PHR_LENGTH_MASK 0x7f
131#define SECURITY_ENABLED_OFFSET 1
132#define SECURITY_ENABLED_BIT 0x08
133#define SECURITY_LEVEL_MASK 0x07
134#define SECURITY_LEVEL_NONE 0x00
135#define SECURITY_LEVEL_MIC_32 0x01
136#define SECURITY_LEVEL_MIC_64 0x02
137#define SECURITY_LEVEL_MIC_128 0x03
138#define SECURITY_LEVEL_ENC_MIC_32 0x05
139#define SECURITY_LEVEL_ENC_MIC_64 0x06
140#define SECURITY_LEVEL_ENC_MIC_128 0x07
141#define SECURITY_LEVEL_MIC_LEVEL_MASK 0x03
143#define SRC_ADDR_TYPE_EXTENDED 0xc0
144#define SRC_ADDR_TYPE_NONE 0x00
145#define SRC_ADDR_TYPE_MASK 0xc0
146#define SRC_ADDR_TYPE_OFFSET 2
147#define SRC_ADDR_TYPE_SHORT 0x80
149#define SRC_ADDR_OFFSET_SHORT_DST 8
150#define SRC_ADDR_OFFSET_EXTENDED_DST 14
155#define FRAME_COUNTER_SIZE 4
156#define IE_HEADER_SIZE 2
157#define IMM_ACK_LENGTH 5
158#define KEY_ID_MODE_1_SIZE 1
159#define KEY_ID_MODE_2_SIZE 5
160#define KEY_ID_MODE_3_SIZE 9
161#define MAX_PACKET_SIZE 127
164#define MIC_128_SIZE 16
167#define SECURITY_CONTROL_SIZE 1
169#define AES_CCM_KEY_SIZE 16
171#define EXTENDED_ADDRESS_SIZE 8
172#define SHORT_ADDRESS_SIZE 2
174#define TURNAROUND_TIME 192UL
175#define CCA_TIME 128UL
176#define ACK_IFS TURNAROUND_TIME
177#define UNIT_BACKOFF_PERIOD (TURNAROUND_TIME + CCA_TIME)
179#define PHY_US_PER_SYMBOL 16
180#define PHY_SYMBOLS_PER_OCTET 2
181#define PHY_SHR_SYMBOLS 10
183#define PHY_MIN_RECEIVER_SENSITIVITY -85
185#define ED_RESULT_MAX 0xff
187#define BROADCAST_ADDRESS ((uint8_t[SHORT_ADDRESS_SIZE]) {0xff, 0xff})
189#define MIN_SIFS_PERIOD_US 192
190#define MIN_LIFS_PERIOD_US 640
191#define MAX_SIFS_FRAME_SIZE 18
193#define NRF_802154_RESERVED_CSMACA_ID (UINT32_MAX - 2)
194#define NRF_802154_RESERVED_DTX_ID (UINT32_MAX - 3)
196#define IE_VENDOR_ID 0x00
197#define IE_VENDOR_SIZE_MIN 3
198#define IE_VENDOR_OUI_OFFSET 0
200#define IE_VENDOR_THREAD_SUBTYPE_OFFSET 3
201#define IE_VENDOR_THREAD_DATA_OFFSET 4
202#define IE_VENDOR_THREAD_OUI 0xeab89b
203#define IE_VENDOR_THREAD_SIZE_MIN 4
205#define IE_VENDOR_THREAD_ACK_PROBING_ID 0x00
206#define IE_VENDOR_THREAD_ACK_SIZE_MIN 5
207#define IE_VENDOR_THREAD_ACK_SIZE_MAX 6
208#define IE_VENDOR_THREAD_RSSI_TOKEN 0x01
209#define IE_VENDOR_THREAD_MARGIN_TOKEN 0x02
210#define IE_VENDOR_THREAD_LQI_TOKEN 0x03
211#define IE_VENDOR_THREAD_RSSI_FLOOR -130
212#define IE_VENDOR_THREAD_MARGIN_FLOOR 0
213#define IE_VENDOR_THREAD_RSSI_CEIL 0
214#define IE_VENDOR_THREAD_MARGIN_CEIL 130
215#define IE_VENDOR_THREAD_CST_ID 0x02
216#define IE_VENDOR_THREAD_CST_SIZE 8
217#define IE_CSL_SYMBOLS_PER_UNIT 10
218#define IE_CSL_PERIOD_MAX 0xffff
219#define IE_CSL_SIZE_MIN 4
220#define IE_CSL_ID 0x1a
224#define IE_LENGTH_MASK 0x7f
225#define IE_LENGTH_OFFSET 0x00
226#define IE_ID_OFFSET_0 0x00
227#define IE_ID_OFFSET_1 0x01
228#define IE_DATA_OFFSET 0x02
229#define IE_HEADER_ELEMENT_ID_OFFSET 0x07
req_originator_t
Definition nrf_802154_const.h:232
@ REQ_ORIG_IFS
Definition nrf_802154_const.h:239
@ REQ_ORIG_HIGHER_LAYER
Definition nrf_802154_const.h:233
@ REQ_ORIG_CSMA_CA
Definition nrf_802154_const.h:236
@ REQ_ORIG_DELAYED_TRX
Definition nrf_802154_const.h:238
@ REQ_ORIG_RSCH
Definition nrf_802154_const.h:235
@ REQ_ORIG_ACK_TIMEOUT
Definition nrf_802154_const.h:237
@ REQ_ORIG_CORE
Definition nrf_802154_const.h:234