39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
74#define UWB2_CMD_TXRXOFF 0x00
75#define UWB2_CMD_TX 0x01
76#define UWB2_CMD_RX 0x02
77#define UWB2_CMD_DTX 0x03
78#define UWB2_CMD_DRX 0x04
79#define UWB2_CMD_DTX_TS 0x05
80#define UWB2_CMD_DRX_TS 0x06
81#define UWB2_CMD_DTX_RS 0x07
82#define UWB2_CMD_DRX_RS 0x08
83#define UWB2_CMD_DTX_REF 0x09
84#define UWB2_CMD_DRX_REF 0x0A
85#define UWB2_CMD_CCA_TX 0x0B
86#define UWB2_CMD_TX_W4R 0x0C
87#define UWB2_CMD_DTX_W4R 0x0D
88#define UWB2_CMD_DTX_TS_W4R 0x0E
89#define UWB2_CMD_DTX_RS_W4R 0x0F
90#define UWB2_CMD_DTX_REF_W4R 0x10
91#define UWB2_CMD_CCA_TX_W4R 0x11
92#define UWB2_CMD_CLR_IRQS 0x12
93#define UWB2_CMD_DB_TOGGLE 0x13
101#define UWB2_REG_DEV_ID 0x0000u
102#define UWB2_REG_EUI_64 0x0004u
103#define UWB2_REG_PANADR 0x000Cu
104#define UWB2_REG_SYS_CFG 0x0010u
105#define UWB2_REG_FF_CFG 0x0014u
106#define UWB2_REG_SPI_RD_CRC 0x0018u
107#define UWB2_REG_SYS_TIME 0x001Cu
108#define UWB2_REG_TX_FCTRL_LO 0x0024u
109#define UWB2_REG_TX_FCTRL_HI 0x0028u
110#define UWB2_REG_DX_TIME 0x002Cu
111#define UWB2_REG_DREF_TIME 0x0030u
112#define UWB2_REG_RX_FWTO 0x0034u
113#define UWB2_REG_SYS_CTRL 0x0038u
114#define UWB2_REG_SYS_ENABLE_LO 0x003Cu
115#define UWB2_REG_SYS_ENABLE_HI 0x0040u
116#define UWB2_REG_SYS_STATUS_LO 0x0044u
117#define UWB2_REG_SYS_STATUS_HI 0x0048u
118#define UWB2_REG_RX_FINFO 0x004Cu
119#define UWB2_REG_RX_TIME 0x0064u
120#define UWB2_REG_TX_TIME 0x0074u
121#define UWB2_REG_TX_RAWST 0x0100u
122#define UWB2_REG_TX_ANTD 0x0104u
123#define UWB2_REG_ACK_RESP_T 0x0108u
124#define UWB2_REG_TX_POWER 0x010Cu
125#define UWB2_REG_CHAN_CTRL 0x0114u
126#define UWB2_REG_LE_PEND_01 0x0118u
127#define UWB2_REG_LE_PEND_23 0x011Cu
128#define UWB2_REG_SPI_COLLISION 0x0120u
129#define UWB2_REG_RDB_STATUS 0x0124u
130#define UWB2_REG_RDB_DIAG 0x0128u
131#define UWB2_REG_AES_CFG 0x0130u
132#define UWB2_REG_AES_IV0 0x0134u
133#define UWB2_REG_AES_IV1 0x0138u
134#define UWB2_REG_AES_IV2 0x013Cu
135#define UWB2_REG_AES_IV3 0x0140u
136#define UWB2_REG_DMA_CFG 0x0144u
137#define UWB2_REG_AES_START 0x014Cu
138#define UWB2_REG_AES_STS 0x0150u
139#define UWB2_REG_AES_KEY 0x0154u
140#define UWB2_REG_STS_CFG 0x0200u
141#define UWB2_REG_STS_CTRL 0x0204u
142#define UWB2_REG_STS_STS 0x0208u
143#define UWB2_REG_STS_KEY 0x020Cu
144#define UWB2_REG_STS_IV 0x021Cu
145#define UWB2_REG_DGC_CFG 0x0318u
146#define UWB2_REG_DGC_CFG_0 0x031Cu
147#define UWB2_REG_DGC_CFG_1 0x0320u
148#define UWB2_REG_DGC_LUT_0 0x0338u
149#define UWB2_REG_DGC_LUT_1 0x033Cu
150#define UWB2_REG_DGC_LUT_2 0x0340u
151#define UWB2_REG_DGC_LUT_3 0x0344u
152#define UWB2_REG_DGC_LUT_4 0x0348u
153#define UWB2_REG_DGC_LUT_5 0x034Cu
154#define UWB2_REG_DGC_LUT_6 0x0350u
155#define UWB2_REG_DGC_DBG 0x0360u
156#define UWB2_REG_EC_CTRL 0x0400u
157#define UWB2_REG_RX_CAL 0x040Cu
158#define UWB2_REG_RX_CAL_RESI 0x0414u
159#define UWB2_REG_RX_CAL_RESQ 0x041Cu
160#define UWB2_REG_RX_CAL_STS 0x0420u
161#define UWB2_REG_GPIO_MODE 0x0500u
162#define UWB2_REG_GPIO_PULL_EN 0x0504u
163#define UWB2_REG_GPIO_DIR 0x0508u
164#define UWB2_REG_GPIO_OUT 0x050Cu
165#define UWB2_REG_GPIO_IRQE 0x0510u
166#define UWB2_REG_GPIO_ISTS 0x0514u
167#define UWB2_REG_GPIO_ISEN 0x0518u
168#define UWB2_REG_GPIO_IMODE 0x051Cu
169#define UWB2_REG_GPIO_IBES 0x0520u
170#define UWB2_REG_GPIO_ICLR 0x0524u
171#define UWB2_REG_GPIO_IDBE 0x0528u
172#define UWB2_REG_GPIO_RAW 0x052Cu
173#define UWB2_REG_DTUNE_0 0x0600u
174#define UWB2_REG_RX_SFD_TOC 0x0602u
175#define UWB2_REG_PRE_TOC 0x0604u
176#define UWB2_REG_DTUNE_3 0x060Cu
177#define UWB2_REG_DTUNE_4 0x0610u
178#define UWB2_REG_DTUNE_5 0x0614u
179#define UWB2_REG_DRX_CAR_INT 0x0629u
180#define UWB2_REG_RF_ENABLE 0x0700u
181#define UWB2_REG_RF_CTRL_MASK 0x0704u
182#define UWB2_REG_RF_SWITCH 0x0714u
183#define UWB2_REG_RF_TX_CTRL_1 0x071Au
184#define UWB2_REG_RF_TX_CTRL_2 0x071Cu
185#define UWB2_REG_TX_TEST 0x0728u
186#define UWB2_REG_SAR_TEST 0x0734u
187#define UWB2_REG_LDO_TUNE_LO 0x0740u
188#define UWB2_REG_LDO_TUNE_HI 0x0744u
189#define UWB2_REG_LDO_CTRL 0x0748u
190#define UWB2_REG_LDO_RLOAD 0x0751u
191#define UWB2_REG_SAR_CTRL 0x0800u
192#define UWB2_REG_SAR_STATUS 0x0804u
193#define UWB2_REG_SAR_READING 0x0808u
194#define UWB2_REG_SAR_WAKE_RD 0x080Cu
195#define UWB2_REG_PGC_CTRL 0x0810u
196#define UWB2_REG_PGC_STATUS 0x0814u
197#define UWB2_REG_PG_TEST 0x0818u
198#define UWB2_REG_PG_CAL_TARGET 0x081Cu
199#define UWB2_REG_PLL_CFG 0x0900u
200#define UWB2_REG_PLL_CC 0x0904u
201#define UWB2_REG_PLL_CAL 0x0908u
202#define UWB2_REG_XTAL 0x0914u
203#define UWB2_REG_AON_DIG_CFG 0x0A00u
204#define UWB2_REG_AON_CTRL 0x0A04u
205#define UWB2_REG_AON_RDATA 0x0A08u
206#define UWB2_REG_AON_ADDR 0x0A0Cu
207#define UWB2_REG_AON_WDATA 0x0A10u
208#define UWB2_REG_AON_CFG 0x0A14u
209#define UWB2_REG_OTP_WDATA 0x0B00u
210#define UWB2_REG_OTP_ADDR 0x0B04u
211#define UWB2_REG_OTP_CFG 0x0B08u
212#define UWB2_REG_OTP_STAT 0x0B0Cu
213#define UWB2_REG_OTP_RDATA 0x0B10u
214#define UWB2_REG_OTP_SRDATA 0x0B14u
215#define UWB2_REG_IP_TS 0x0C00u
216#define UWB2_REG_STS_TS 0x0C08u
217#define UWB2_REG_STS1_TS 0x0C10u
218#define UWB2_REG_TDOA 0x0C18u
219#define UWB2_REG_PDOA 0x0C1Eu
220#define UWB2_REG_CIA_DIAG_0 0x0C20u
221#define UWB2_REG_IP_DIAG_0 0x0C28u
222#define UWB2_REG_IP_DIAG_1 0x0C2Cu
223#define UWB2_REG_IP_DIAG_2 0x0C30u
224#define UWB2_REG_IP_DIAG_3 0x0C34u
225#define UWB2_REG_IP_DIAG_4 0x0C38u
226#define UWB2_REG_IP_DIAG_8 0x0C48u
227#define UWB2_REG_IP_DIAG_12 0x0C58u
228#define UWB2_REG_STS_DIAG_0 0x0C5Cu
229#define UWB2_REG_STS_DIAG_1 0x0C60u
230#define UWB2_REG_STS_DIAG_2 0x0C64u
231#define UWB2_REG_STS_DIAG_3 0x0C68u
232#define UWB2_REG_STS_DIAG_4 0x0D00u
233#define UWB2_REG_STS_DIAG_8 0x0D10u
234#define UWB2_REG_STS_DIAG_12 0x0D20u
235#define UWB2_REG_STS1_DIAG_0 0x0D38u
236#define UWB2_REG_STS1_DIAG_1 0x0D3Cu
237#define UWB2_REG_STS1_DIAG_2 0x0D40u
238#define UWB2_REG_STS1_DIAG_3 0x0D44u
239#define UWB2_REG_STS1_DIAG_4 0x0D48u
240#define UWB2_REG_STS1_DIAG_8 0x0D58u
241#define UWB2_REG_STS1_DIAG_12 0x0D68u
242#define UWB2_REG_CIA_CONF 0x0E00u
243#define UWB2_REG_FP_CONF 0x0E04u
244#define UWB2_REG_IP_CONF 0x0E0Cu
245#define UWB2_REG_STS_CONF_0 0x0E12u
246#define UWB2_REG_STS_CONF_1 0x0E16u
247#define UWB2_REG_CIA_ADJUST 0x0E1Au
248#define UWB2_REG_EVC_CTRL 0x0F00u
249#define UWB2_REG_EVC_PHE 0x0F04u
250#define UWB2_REG_EVC_RSE 0x0F06u
251#define UWB2_REG_EVC_FCG 0x0F08u
252#define UWB2_REG_EVC_FCE 0x0F0Au
253#define UWB2_REG_EVC_FFR 0x0F0Cu
254#define UWB2_REG_EVC_OVR 0x0F0Eu
255#define UWB2_REG_EVC_STO 0x0F10u
256#define UWB2_REG_EVC_PTO 0x0F12u
257#define UWB2_REG_EVC_FWTO 0x0F14u
258#define UWB2_REG_EVC_TXFS 0x0F16u
259#define UWB2_REG_EVC_HPW 0x0F18u
260#define UWB2_REG_EVC_SWCE 0x0F1Au
261#define UWB2_REG_EVC_RES1 0x0F1Cu
262#define UWB2_REG_DIAG_TMC 0x0F24u
263#define UWB2_REG_EVC_CPQE 0x0F28u
264#define UWB2_REG_EVC_VWARN 0x0F2Au
265#define UWB2_REG_SPI_MODE 0x0F2Cu
266#define UWB2_REG_SYS_STATE 0x0F30u
267#define UWB2_REG_FCMD_STAT 0x0F3Cu
268#define UWB2_REG_CTR_DBG 0x0F48u
269#define UWB2_REG_SPICRCINIT 0x0F4Cu
270#define UWB2_REG_SOFT_RST 0x1100u
271#define UWB2_REG_CLK_CTRL 0x1104u
272#define UWB2_REG_SEQ_CTRL 0x1108u
273#define UWB2_REG_TXFSEQ 0x1112u
274#define UWB2_REG_LED_CTRL 0x1116u
275#define UWB2_REG_RX_SNIFF 0x111Au
276#define UWB2_REG_BIAS_CTRL 0x111Fu
277#define UWB2_REG_RX_BUFFER_0 0x1200u
278#define UWB2_REG_RX_BUFFER_1 0x1300u
279#define UWB2_REG_TX_BUFFER 0x1400u
280#define UWB2_REG_ACC_MEM 0x1500u
281#define UWB2_REG_SCRATCH_RAM 0x1600u
282#define UWB2_REG_AES_KEY_1 0x1700u
283#define UWB2_REG_AES_KEY_2 0x1710u
284#define UWB2_REG_AES_KEY_3 0x1720u
285#define UWB2_REG_AES_KEY_4 0x1730u
286#define UWB2_REG_AES_KEY_5 0x1740u
287#define UWB2_REG_AES_KEY_6 0x1750u
288#define UWB2_REG_AES_KEY_7 0x1760u
289#define UWB2_REG_AES_KEY_8 0x1770u
290#define UWB2_REG_SET1_SET2 0x1800u
291#define UWB2_REG_INDIRECT_PTR_A 0x1D00u
292#define UWB2_REG_INDIRECT_PTR_B 0x1E00u
293#define UWB2_REG_FINT_STAT 0x1F00u
294#define UWB2_REG_PTR_ADDR_A 0x1F04u
295#define UWB2_REG_PTR_OFFSET_A 0x1F08u
296#define UWB2_REG_PTR_ADDR_B 0x1F0Cu
297#define UWB2_REG_PTR_OFFSET_B 0x1F10u
303#define UWB2_OTP_ADR_EUID_LO 0x0000u
304#define UWB2_OTP_ADR_EUID_HI 0x0001u
305#define UWB2_OTP_ADR_AEUID_LO 0x0002u
306#define UWB2_OTP_ADR_AEUID_HI 0x0003u
307#define UWB2_OTP_ADR_LDOTUNE_LO 0x0004u
308#define UWB2_OTP_ADR_LDOTUNE_HI 0x0005u
309#define UWB2_OTP_ADR_PART_ID 0x0006u
310#define UWB2_OTP_ADR_LOT_ID 0x0007u
311#define UWB2_OTP_ADR_VBAT 0x0008u
312#define UWB2_OTP_ADR_TEMP 0x0009u
313#define UWB2_OTP_ADR_BIASTUNE 0x000Au
314#define UWB2_OTP_ADR_ANTENNA_DELAY 0x000Bu
315#define UWB2_OTP_ADR_AOA_ISO 0x000Cu
316#define UWB2_OTP_ADR_WS_LOT_ID_LO 0x000Du
317#define UWB2_OTP_ADR_WS_LOT_ID_HI 0x000Eu
318#define UWB2_OTP_ADR_WS_LOC 0x000Fu
319#define UWB2_OTP_ADR_XTAL_TRIM 0x001Eu
320#define UWB2_OTP_ADR_OTP_REVISION 0x001Fu
321#define UWB2_OTP_ADR_DGC_TUNE 0x0020u
322#define UWB2_OTP_ADR_PLL_LOCK_CODE 0x0035u
323#define UWB2_OTP_ADR_AES_KEY_START 0x0078u
324#define UWB2_OTP_ADR_AES_KEY_END 0x007Fu
342#define UWB2_SYS_CFG_FAST_AAT_MASK 0x00040000ul
343#define UWB2_SYS_CFG_PDOA_MODE_MASK 0x00030000ul
344#define UWB2_SYS_CFG_CP_SDC_SPC_MASK 0x0000B000ul
345#define UWB2_SYS_CFG_AUTO_ACK_MASK 0x00000800ul
346#define UWB2_SYS_CFG_RXAUTR_MASK 0x00000400ul
347#define UWB2_SYS_CFG_RXWTOE_MASK 0x00000200ul
348#define UWB2_SYS_CFG_CIA_STS_MASK 0x00000100ul
349#define UWB2_SYS_CFG_CIA_IPATOV_MASK 0x00000080ul
350#define UWB2_SYS_CFG_SPI_CRCEN_MASK 0x00000040ul
351#define UWB2_SYS_CFG_PHR_6M8_MASK 0x00000020ul
352#define UWB2_SYS_CFG_PHR_MODE_MASK 0x00000010ul
353#define UWB2_SYS_CFG_DIS_DRXB_MASK 0x00000008ul
354#define UWB2_SYS_CFG_DIS_FCE_MASK 0x00000004ul
355#define UWB2_SYS_CFG_DIS_FCS_TX_MASK 0x00000002ul
356#define UWB2_SYS_CFG_FFEN_MASK 0x00000001ul
362#define UWB2_TX_FCTRL_LO_TXB_OFFSET_MASK 0x03FF0000ul
363#define UWB2_TX_FCTRL_LO_TXPSR_MASK 0x0000F000ul
364#define UWB2_TX_FCTRL_LO_TR_MASK 0x00000800ul
365#define UWB2_TX_FCTRL_LO_TX_BR_MASK 0x00000400ul
366#define UWB2_TX_FCTRL_LO_TXFLEN_MASK 0x000003FFul
372#define UWB2_TX_FCTRL_HI_FINE_PLEN_MASK 0xFF00u
378#define UWB2_SYS_ENABLE_LO_ARFE_EN_MASK 0x20000000ul
379#define UWB2_SYS_ENABLE_LO_CPERR_EN_MASK 0x10000000ul
380#define UWB2_SYS_ENABLE_LO_HPDWARN_EN_MASK 0x08000000ul
381#define UWB2_SYS_ENABLE_LO_RXSTO_EN_MASK 0x04000000ul
382#define UWB2_SYS_ENABLE_LO_PLLHILO_EN_MASK 0x02000000ul
383#define UWB2_SYS_ENABLE_LO_RCINIT_EN_MASK 0x01000000ul
384#define UWB2_SYS_ENABLE_LO_SPIRDY_EN_MASK 0x00800000ul
385#define UWB2_SYS_ENABLE_LO_RXPTO_EN_MASK 0x00200000ul
386#define UWB2_SYS_ENABLE_LO_RXOVRR_EN_MASK 0x00100000ul
387#define UWB2_SYS_ENABLE_LO_VWARN_EN_MASK 0x00080000ul
388#define UWB2_SYS_ENABLE_LO_CIAERR_EN_MASK 0x00040000ul
389#define UWB2_SYS_ENABLE_LO_RXFTO_EN_MASK 0x00020000ul
390#define UWB2_SYS_ENABLE_LO_RXFSL_EN_MASK 0x00010000ul
391#define UWB2_SYS_ENABLE_LO_RXFCE_EN_MASK 0x00008000ul
392#define UWB2_SYS_ENABLE_LO_RXFCG_EN_MASK 0x00004000ul
393#define UWB2_SYS_ENABLE_LO_RXFR_EN_MASK 0x00002000ul
394#define UWB2_SYS_ENABLE_LO_RXPHE_EN_MASK 0x00001000ul
395#define UWB2_SYS_ENABLE_LO_RXPHD_EN_MASK 0x00000800ul
396#define UWB2_SYS_ENABLE_LO_CIADONE_EN_MASK 0x00000400ul
397#define UWB2_SYS_ENABLE_LO_RXSFDD_EN_MASK 0x00000200ul
398#define UWB2_SYS_ENABLE_LO_RXPRD_EN_MASK 0x00000100ul
399#define UWB2_SYS_ENABLE_LO_TXFRS_EN_MASK 0x00000080ul
400#define UWB2_SYS_ENABLE_LO_TXPHS_EN_MASK 0x00000040ul
401#define UWB2_SYS_ENABLE_LO_TXPRS_EN_MASK 0x00000020ul
402#define UWB2_SYS_ENABLE_LO_TXFRB_EN_MASK 0x00000010ul
403#define UWB2_SYS_ENABLE_LO_AAT_EN_MASK 0x00000008ul
404#define UWB2_SYS_ENABLE_LO_SPICRCE_EN_MASK 0x00000004ul
405#define UWB2_SYS_ENABLE_LO_CPLOCK_EN_MASK 0x00000002ul
411#define UWB2_SYS_STATUS_LO_ARFE_MASK 0x20000000ul
412#define UWB2_SYS_STATUS_LO_CPERR_MASK 0x10000000ul
413#define UWB2_SYS_STATUS_LO_HPDWARN_MASK 0x08000000ul
414#define UWB2_SYS_STATUS_LO_RXSTO_MASK 0x04000000ul
415#define UWB2_SYS_STATUS_LO_PLLHILO_MASK 0x02000000ul
416#define UWB2_SYS_STATUS_LO_RCINIT_MASK 0x01000000ul
417#define UWB2_SYS_STATUS_LO_SPIRDY_MASK 0x00800000ul
418#define UWB2_SYS_STATUS_LO_RXPTO_MASK 0x00200000ul
419#define UWB2_SYS_STATUS_LO_RXOVRR_MASK 0x00100000ul
420#define UWB2_SYS_STATUS_LO_VWARN_MASK 0x00080000ul
421#define UWB2_SYS_STATUS_LO_CIAERR_MASK 0x00040000ul
422#define UWB2_SYS_STATUS_LO_RXFTO_MASK 0x00020000ul
423#define UWB2_SYS_STATUS_LO_RXFSL_MASK 0x00010000ul
424#define UWB2_SYS_STATUS_LO_RXFCE_MASK 0x00008000ul
425#define UWB2_SYS_STATUS_LO_RXFCG_MASK 0x00004000ul
426#define UWB2_SYS_STATUS_LO_RXFR_MASK 0x00002000ul
427#define UWB2_SYS_STATUS_LO_RXPHE_MASK 0x00001000ul
428#define UWB2_SYS_STATUS_LO_RXPHD_MASK 0x00000800ul
429#define UWB2_SYS_STATUS_LO_CIADONE_MASK 0x00000400ul
430#define UWB2_SYS_STATUS_LO_RXSFDD_MASK 0x00000200ul
431#define UWB2_SYS_STATUS_LO_RXPRD_MASK 0x00000100ul
432#define UWB2_SYS_STATUS_LO_TXFRS_MASK 0x00000080ul
433#define UWB2_SYS_STATUS_LO_TXPHS_MASK 0x00000040ul
434#define UWB2_SYS_STATUS_LO_TXPRS_MASK 0x00000020ul
435#define UWB2_SYS_STATUS_LO_TXFRB_MASK 0x00000010ul
436#define UWB2_SYS_STATUS_LO_AAT_MASK 0x00000008ul
437#define UWB2_SYS_STATUS_LO_SPICRCE_MASK 0x00000004ul
438#define UWB2_SYS_STATUS_LO_CPLOCK_MASK 0x00000002ul
439#define UWB2_SYS_STATUS_LO_IRQS_MASK 0x00000001ul
445#define UWB2_SYS_STATUS_HI_CCA_FAIL_MASK 0x1000u
446#define UWB2_SYS_STATUS_HI_SPIERR_MASK 0x0800u
447#define UWB2_SYS_STATUS_HI_SPI_UNF_MASK 0x0400u
448#define UWB2_SYS_STATUS_HI_SPI_OVF_MASK 0x0200u
449#define UWB2_SYS_STATUS_HI_CMD_ERR_MASK 0x0100u
450#define UWB2_SYS_STATUS_HI_AER_ERR_MASK 0x0080u
451#define UWB2_SYS_STATUS_HI_AES_DONE_MASK 0x0040u
452#define UWB2_SYS_STATUS_HI_GPIOIRQ_MASK 0x0020u
453#define UWB2_SYS_STATUS_HI_VT_DET_MASK 0x0010u
454#define UWB2_SYS_STATUS_HI_RXPREJ_MASK 0x0002u
460#define UWB2_CHAN_CTRL_RX_PCODE_MASK 0x1F00u
461#define UWB2_CHAN_CTRL_TX_PCODE_MASK 0x00F8u
462#define UWB2_CHAN_CTRL_SFD_TYPE_IEEE_4A 0x0000u
463#define UWB2_CHAN_CTRL_SFD_TYPE_DW_8 0x0002u
464#define UWB2_CHAN_CTRL_SFD_TYPE_DW_16 0x0004u
465#define UWB2_CHAN_CTRL_SFD_TYPE_IEEE_4Z 0x0006u
466#define UWB2_CHAN_CTRL_SFD_TYPE_MASK 0x0006u
467#define UWB2_CHAN_CTRL_RF_CHAN_MASK 0x0001u
473#define UWB2_RX_FINFO_RXPACC_MASK 0xFFF00000ul
474#define UWB2_RX_FINFO_RXPSR_MASK 0x000C0000ul
475#define UWB2_RX_FINFO_RXPRF_MASK 0x00030000ul
476#define UWB2_RX_FINFO_RNG_MASK 0x00008000ul
477#define UWB2_RX_FINFO_RXBR_MASK 0x00002000ul
478#define UWB2_RX_FINFO_RXNSPL_MASK 0x00001800ul
479#define UWB2_RX_FINFO_RXFLEN_MASK 0x000003FFul
485#define UWB2_STS_CFG_CPS_LEN_64 0x0007u
486#define UWB2_STS_CFG_CPS_LEN_MASK 0x00FFu
487#define UWB2_STS_CFG_RESERVED_BITS 0x1000u
493#define UWB2_RX_TUNE_DGC_CFG_THR_64_OPTIMISED 0x6400u
494#define UWB2_RX_TUNE_DGC_CFG_THR_64_MASK 0x7E00u
495#define UWB2_RX_TUNE_DGC_CFG_RX_TUNE_EN_MASK 0x0001u
496#define UWB2_RX_TUNE_DGC_CFG_RESERVED_BITS 0x80F4u
497#define UWB2_RX_TUNE_DGC_CFG_0 0x10000240ul
498#define UWB2_RX_TUNE_DGC_CFG_1 0x1B6DA489ul
499#define UWB2_RX_TUNE_DGC_LUT_0_CH5 0x0001C0FDul
500#define UWB2_RX_TUNE_DGC_LUT_0_CH9 0x0002A8FEul
501#define UWB2_RX_TUNE_DGC_LUT_1_CH5 0x0001C43Eul
502#define UWB2_RX_TUNE_DGC_LUT_1_CH9 0x0002AC36ul
503#define UWB2_RX_TUNE_DGC_LUT_2_CH5 0x0001C6BEul
504#define UWB2_RX_TUNE_DGC_LUT_2_CH9 0x0002A5FEul
505#define UWB2_RX_TUNE_DGC_LUT_3_CH5 0x0001C77Eul
506#define UWB2_RX_TUNE_DGC_LUT_3_CH9 0x0002AF3Eul
507#define UWB2_RX_TUNE_DGC_LUT_4_CH5 0x0001C736ul
508#define UWB2_RX_TUNE_DGC_LUT_4_CH9 0x0002AF7Dul
509#define UWB2_RX_TUNE_DGC_LUT_5_CH5 0x0001CFB5ul
510#define UWB2_RX_TUNE_DGC_LUT_5_CH9 0x0002AFB5ul
511#define UWB2_RX_TUNE_DGC_LUT_6_CH5 0x0001CFF5ul
512#define UWB2_RX_TUNE_DGC_LUT_6_CH9 0x0002AFB5ul
518#define UWB2_RX_CAL_COMP_DLY_EN_READ 0x00010000ul
519#define UWB2_RX_CAL_COMP_DLY_OPTIMAL 0x00020000ul
520#define UWB2_RX_CAL_COMP_DLY_MASK 0x000F0000ul
521#define UWB2_RX_CAL_CAL_EN_MASK 0x00000010ul
522#define UWB2_RX_CAL_CAL_MODE_NORMAL 0x00000000ul
523#define UWB2_RX_CAL_CAL_MODE_CALIBRATION 0x00000001ul
524#define UWB2_RX_CAL_CAL_MODE_MASK 0x00000003ul
530#define UWB2_RX_CAL_STS_CALIBRATION_DONE 0x01
536#define UWB2_RX_CAL_RESI_CALIBRATION_FAILED 0x1FFFFFFFul
542#define UWB2_RX_CAL_RESQ_CALIBRATION_FAILED 0x1FFFFFFFul
548#define UWB2_GPIO_MODE_MSGP8_GPIO8 0x01000000ul
549#define UWB2_GPIO_MODE_MSGP8_IRQ 0x00000000ul
550#define UWB2_GPIO_MODE_MSGP8_MASK 0x07000000ul
551#define UWB2_GPIO_MODE_MSGP7_GPIO7 0x00200000ul
552#define UWB2_GPIO_MODE_MSGP7_SYNC 0x00000000ul
553#define UWB2_GPIO_MODE_MSGP7_MASK 0x00E00000ul
554#define UWB2_GPIO_MODE_MSGP6_EXTRXE 0x00040000ul
555#define UWB2_GPIO_MODE_MSGP6_GPIO6 0x00000000ul
556#define UWB2_GPIO_MODE_MSGP6_MASK 0x001C0000ul
557#define UWB2_GPIO_MODE_MSGP5_EXTTXE 0x00008000ul
558#define UWB2_GPIO_MODE_MSGP5_GPIO5 0x00000000ul
559#define UWB2_GPIO_MODE_MSGP5_MASK 0x00038000ul
560#define UWB2_GPIO_MODE_MSGP4_IRQ 0x00002000ul
561#define UWB2_GPIO_MODE_MSGP4_EXTPA 0x00001000ul
562#define UWB2_GPIO_MODE_MSGP4_GPIO4 0x00000000ul
563#define UWB2_GPIO_MODE_MSGP4_MASK 0x00007000ul
564#define UWB2_GPIO_MODE_MSGP3_PDOA_SW_3 0x00000400ul
565#define UWB2_GPIO_MODE_MSGP3_TXLED 0x00000200ul
566#define UWB2_GPIO_MODE_MSGP3_GPIO3 0x00000000ul
567#define UWB2_GPIO_MODE_MSGP3_MASK 0x00000E00ul
568#define UWB2_GPIO_MODE_MSGP2_PDOA_SW_2 0x00000080ul
569#define UWB2_GPIO_MODE_MSGP2_RXLED 0x00000040ul
570#define UWB2_GPIO_MODE_MSGP2_GPIO2 0x00000000ul
571#define UWB2_GPIO_MODE_MSGP2_MASK 0x000001C0ul
572#define UWB2_GPIO_MODE_MSGP1_PDOA_SW_1 0x00000010ul
573#define UWB2_GPIO_MODE_MSGP1_SFDLED 0x00000008ul
574#define UWB2_GPIO_MODE_MSGP1_GPIO1 0x00000000ul
575#define UWB2_GPIO_MODE_MSGP1_MASK 0x00000038ul
576#define UWB2_GPIO_MODE_MSGP0_PDOA_SW_0 0x00000002ul
577#define UWB2_GPIO_MODE_MSGP0_RXOKLED 0x00000001ul
578#define UWB2_GPIO_MODE_MSGP0_GPIO0 0x00000000ul
579#define UWB2_GPIO_MODE_MSGP0_MASK 0x00000007ul
585#define UWB2_DTUNE_0_DTOB4_MASK 0x0010u
586#define UWB2_DTUNE_0_PAC_MASK 0x0003u
587#define UWB2_DTUNE_0_RESERVED_BITS 0x100Cu
593#define UWB2_RX_SFD_TOC_DEFAULT 0x0081u
599#define UWB2_DTUNE_3_DEFAULT 0xAF5F584Cul
600#define UWB2_DTUNE_3_OPTIMAL 0xAF5F35CCul
606#define UWB2_DTUNE_4_RX_SFD_HLDOFF 0x20000000ul
607#define UWB2_DTUNE_4_RX_SFD_HLDOFF_DEFAULT 0x14000000ul
608#define UWB2_DTUNE_4_RX_SFD_HLDOFF_MASK 0xFF000000ul
614#define UWB2_RF_TX_CTRL_1_OPTIMAL 0x0E
620#define UWB2_RF_TX_CTRL_2_CHANNEL_5 0x1C071134ul
621#define UWB2_RF_TX_CTRL_2_CHANNEL_9 0x1C010034ul
627#define UWB2_LDO_CTRL_VDDHVTX_VREF_MASK 0x08000000ul
628#define UWB2_LDO_CTRL_VDDTX2_VREF_MASK 0x00400000ul
629#define UWB2_LDO_CTRL_VDDTX1_VREF_MASK 0x00200000ul
630#define UWB2_LDO_CTRL_VDDHVTX_EN_MASK 0x00000800ul
631#define UWB2_LDO_CTRL_VDDIF2_EN_MASK 0x00000100ul
632#define UWB2_LDO_CTRL_VDDTX2_EN_MASK 0x00000040ul
633#define UWB2_LDO_CTRL_VDDTX1_EN_MASK 0x00000020ul
634#define UWB2_LDO_CTRL_VDDPLL_EN_MASK 0x00000010ul
635#define UWB2_LDO_CTRL_VDDMS3_EN_MASK 0x00000004ul
636#define UWB2_LDO_CTRL_VDDMS2_EN_MASK 0x00000002ul
637#define UWB2_LDO_CTRL_VDDMS1_EN_MASK 0x00000001ul
643#define UWB2_LDO_RLOAD_OPTIMAL 0x14
649#define UWB2_PLL_CFG_CHANNEL_5 0x1F3Cu
650#define UWB2_PLL_CFG_CHANNEL_9 0x0F3Cu
656#define UWB2_PLL_CAL_CAL_EN_MASK 0x0100u
657#define UWB2_PLL_CAL_PLL_CFG_LD_MASK 0x0030u
658#define UWB2_PLL_CAL_USE_OLD_MASK 0x0002u
659#define UWB2_PLL_CAL_RESERVED_BITS 0x0001u
660#define UWB2_PLL_CAL_OPTIMAL 0x0081u
666#define UWB2_XTAL_TRIM_DEFAULT 0x2E
667#define UWB2_XTAL_TRIM_MASK 0x3F
673#define UWB2_OTP_CFG_DGC_SEL_MASK 0x2000u
674#define UWB2_OTP_CFG_OPS_SEL_LONG 0x0000u
675#define UWB2_OTP_CFG_OPS_SEL_SHORT 0x1000u
676#define UWB2_OTP_CFG_OPS_SEL_MASK 0x1800u
677#define UWB2_OTP_CFG_OPS_KICK_MASK 0x0400u
678#define UWB2_OTP_CFG_BIAS_KICK_MASK 0x0100u
679#define UWB2_OTP_CFG_LDO_KICK_MASK 0x0080u
680#define UWB2_OTP_CFG_DGC_KICK_MASK 0x0040u
681#define UWB2_OTP_CFG_OTP_WRITE_MR_MASK 0x0008u
682#define UWB2_OTP_CFG_OTP_WRITE_MASK 0x0004u
683#define UWB2_OTP_CFG_OTP_READ_MASK 0x0002u
684#define UWB2_OTP_CFG_OTP_MAN_MASK 0x0001u
690#define UWB2_STS_CONF_1_STS_PGR_EN_MASK 0x80000000ul
691#define UWB2_STS_CONF_1_STS_SS_EN_MASK 0x40000000ul
692#define UWB2_STS_CONF_1_STS_CQ_EN_MASK 0x20000000ul
693#define UWB2_STS_CONF_1_FP_AGREED_EN_MASK 0x10000000ul
694#define UWB2_STS_CONF_1_RES_B0_DEFAULT 0x00000094ul
695#define UWB2_STS_CONF_1_RES_B0_MASK 0x000000FFul
696#define UWB2_STS_CONF_1_RESERVED_BITS 0x003EED00ul
702#define UWB2_DIAG_TMC_CIA_RUN_MASK 0x04000000ul
703#define UWB2_DIAG_TMC_CIA_WDEN_MASK 0x01000000ul
704#define UWB2_DIAG_TMC_HIRQ_POL_MASK 0x00200000ul
705#define UWB2_DIAG_TMC_TX_PSTM_MASK 0x00000010ul
711#define UWB2_SYS_STATE_PMSC_STATE_WAKEUP 0x00000000ul
712#define UWB2_SYS_STATE_PMSC_STATE_IDLE_RC 0x00010000ul
713#define UWB2_SYS_STATE_PMSC_STATE_IDLE 0x00030000ul
714#define UWB2_SYS_STATE_PMSC_STATE_TX 0x00080000ul
715#define UWB2_SYS_STATE_PMSC_STATE_RX 0x00120000ul
716#define UWB2_SYS_STATE_PMSC_STATE_MASK 0x001F0000ul
717#define UWB2_SYS_STATE_RX_STATE_IDLE 0x00000000ul
718#define UWB2_SYS_STATE_RX_STATE_START_ANALOG 0x00000100ul
719#define UWB2_SYS_STATE_RX_STATE_RX_RDY 0x00000400ul
720#define UWB2_SYS_STATE_RX_STATE_PREAMBLE_FND 0x00000500ul
721#define UWB2_SYS_STATE_RX_STATE_PREAMBLE_TO 0x00000600ul
722#define UWB2_SYS_STATE_RX_STATE_SFD_FND 0x00000700ul
723#define UWB2_SYS_STATE_RX_STATE_CNFG_PHR_RX 0x00000800ul
724#define UWB2_SYS_STATE_RX_STATE_PHR_RX_STRT 0x00000900ul
725#define UWB2_SYS_STATE_RX_STATE_DATA_RATE_RDY 0x00000A00ul
726#define UWB2_SYS_STATE_RX_STATE_DATA_RX_SEQ 0x00000C00ul
727#define UWB2_SYS_STATE_RX_STATE_CNFG_DATA_RX 0x00000D00ul
728#define UWB2_SYS_STATE_RX_STATE_PHR_NOT_OK 0x00000E00ul
729#define UWB2_SYS_STATE_RX_STATE_LAST_SYMBOL 0x00000F00ul
730#define UWB2_SYS_STATE_RX_STATE_WAIT_RSD_DONE 0x00001000ul
731#define UWB2_SYS_STATE_RX_STATE_RSP_OK 0x00001100ul
732#define UWB2_SYS_STATE_RX_STATE_RSP_NOT_OK 0x00001200ul
733#define UWB2_SYS_STATE_RX_STATE_MASK 0x00003F00ul
734#define UWB2_SYS_STATE_TX_STATE_IDLE 0x00000000ul
735#define UWB2_SYS_STATE_TX_STATE_PREAMBLE 0x00000001ul
736#define UWB2_SYS_STATE_TX_STATE_SFD 0x00000002ul
737#define UWB2_SYS_STATE_TX_STATE_PHR 0x00000003ul
738#define UWB2_SYS_STATE_TX_STATE_SDE 0x00000004ul
739#define UWB2_SYS_STATE_TX_STATE_DATA 0x00000005ul
740#define UWB2_SYS_STATE_TX_STATE_MASK 0x0000000Ful
746#define UWB2_CLK_CTRL_LP_CLK_EN_MASK 0x00800000ul
747#define UWB2_CLK_CTRL_GPIO_DRST_N_MASK 0x00080000ul
748#define UWB2_CLK_CTRL_GPIO_DCLK_EN_MASK 0x00040000ul
749#define UWB2_CLK_CTRL_GPIO_CLK_EN_MASK 0x00010000ul
750#define UWB2_CLK_CTRL_ACC_MCLK_EN_MASK 0x00008000ul
751#define UWB2_CLK_CTRL_SAR_CLK_EN_MASK 0x00000400ul
752#define UWB2_CLK_CTRL_CIA_CLK_EN_MASK 0x00000100ul
753#define UWB2_CLK_CTRL_ACC_CLK_EN_MASK 0x00000040ul
754#define UWB2_CLK_CTRL_TX_CLK_AUTO 0x00000000ul
755#define UWB2_CLK_CTRL_TX_CLK_FORCE 0x00000010ul
756#define UWB2_CLK_CTRL_TX_CLK_MASK 0x00000030ul
757#define UWB2_CLK_CTRL_RX_CLK_AUTO 0x00000000ul
758#define UWB2_CLK_CTRL_RX_CLK_FORCE 0x00000004ul
759#define UWB2_CLK_CTRL_RX_CLK_MASK 0x0000000Cul
760#define UWB2_CLK_CTRL_SYS_CLK_AUTO 0x00000000ul
761#define UWB2_CLK_CTRL_SYS_CLK_FORCE_FC_4 0x00000001ul
762#define UWB2_CLK_CTRL_SYS_CLK_FORCE_PLL 0x00000002ul
763#define UWB2_CLK_CTRL_SYS_CLK_FORCE_FC 0x00000003ul
764#define UWB2_CLK_CTRL_SYS_CLK_MASK 0x00000003ul
765#define UWB2_CLK_CTRL_RESERVED_BITS 0xF0300200ul
771#define UWB2_SEQ_CTRL_LP_CLK_DIV_MASK 0xFC000000ul
772#define UWB2_SEQ_CTRL_FORCE2INIT_MASK 0x00800000ul
773#define UWB2_SEQ_CTRL_CIARUNE_MASK 0x00020000ul
774#define UWB2_SEQ_CTRL_PLL_SYNC_MASK 0x00008000ul
775#define UWB2_SEQ_CTRL_ARXSLP_MASK 0x00001000ul
776#define UWB2_SEQ_CTRL_ATXSLP_MASK 0x00000800ul
777#define UWB2_SEQ_CTRL_AINIT2IDLE_MASK 0x00000100ul
778#define UWB2_SEQ_CTRL_RESERVED_BITS 0x00010638ul
784#define UWB2_LED_CTRL_FORCE_TRIG_MASK 0x000F0000ul
785#define UWB2_LED_CTRL_BLINK_EN_MASK 0x00000100ul
786#define UWB2_LED_CTRL_BLINK_TIM_200MS 0x00000010ul
787#define UWB2_LED_CTRL_BLINK_TIM_400MS 0x00000020ul
788#define UWB2_LED_CTRL_BLINK_TIM_MASK 0x000000FFul
794#define UWB2_BIAS_CTRL_MASK 0x1F
800#define UWB2_CHANNEL_5 0x05
801#define UWB2_CHANNEL_9 0x09
802#define UWB2_TX_PLEN_32 0x04
803#define UWB2_TX_PLEN_64 0x01
804#define UWB2_TX_PLEN_128 0x05
805#define UWB2_TX_PLEN_256 0x09
806#define UWB2_TX_PLEN_512 0x0D
807#define UWB2_TX_PLEN_1024 0x02
808#define UWB2_TX_PLEN_1536 0x06
809#define UWB2_TX_PLEN_2048 0x0A
810#define UWB2_TX_PLEN_4096 0x03
811#define UWB2_PAC_SIZE_4 0x03
812#define UWB2_PAC_SIZE_8 0x00
813#define UWB2_PAC_SIZE_16 0x01
814#define UWB2_PAC_SIZE_32 0x02
815#define UWB2_TX_CODE_MIN 0x01
816#define UWB2_TX_CODE_9 0x09
817#define UWB2_TX_CODE_24 0x18
818#define UWB2_TX_CODE_MAX 0x1D
819#define UWB2_RX_CODE_MIN 0x01
820#define UWB2_RX_CODE_9 0x09
821#define UWB2_RX_CODE_24 0x18
822#define UWB2_RX_CODE_MAX 0x1D
823#define UWB2_SFD_TYPE_IEEE_4A 0x00
824#define UWB2_SFD_TYPE_DW_8 0x01
825#define UWB2_SFD_TYPE_DW_16 0x02
826#define UWB2_SFD_TYPE_IEEE_4Z 0x03
827#define UWB2_DATA_RATE_850KBS 0x00
828#define UWB2_DATA_RATE_6800KBS 0x01
834#define UWB2_DEFAULT_CHANNEL UWB2_CHANNEL_5
835#define UWB2_DEFAULT_TX_PLEN UWB2_TX_PLEN_128
836#define UWB2_DEFAULT_PAC UWB2_PAC_SIZE_8
837#define UWB2_DEFAULT_TX_CODE UWB2_TX_CODE_9
838#define UWB2_DEFAULT_RX_CODE UWB2_RX_CODE_9
839#define UWB2_DEFAULT_SFD_TYPE UWB2_SFD_TYPE_DW_8
840#define UWB2_DEFAULT_DATA_RATE UWB2_DATA_RATE_6800KBS
841#define UWB2_DEFAULT_SFD_TO ( 128 + 1 + 8 - 8 )
847#define UWB2_RX_TX_LEDS_DISABLE 0
848#define UWB2_RX_TX_LEDS_ENABLE 1
854#define UWB2_IC_STATE_INIT 0
855#define UWB2_IC_STATE_IDLE 1
856#define UWB2_IC_STATE_IDLE_RC 2
862#define UWB2_DEV_ID 0xDECA0302ul
863#define UWB2_DEV_ID_RIDTAG_MASK 0xFFFF0000ul
864#define UWB2_DEV_ID_MODEL_MASK 0x0000FF00ul
865#define UWB2_DEV_ID_VER_MASK 0x000000F0ul
866#define UWB2_DEV_ID_REV_MASK 0x0000000Ful
872#define UWB2_MASK_ALL_32 0xFFFFFFFFul
873#define UWB2_MASK_NONE_32 0x00000000ul
874#define UWB2_MASK_ALL_16 0xFFFFu
875#define UWB2_MASK_NONE_16 0x0000u
876#define UWB2_MASK_ALL_8 0xFF
877#define UWB2_MASK_NONE_8 0x00
883#define UWB2_SPI_WRITE 0x8000u
884#define UWB2_SPI_16BIT_ADDR 0x4000u
885#define UWB2_SPI_FAST_CMD 0x0100u
886#define UWB2_SPI_MASKED_WRITE_8BIT 0x0001u
887#define UWB2_SPI_MASKED_WRITE_16BIT 0x0002u
888#define UWB2_SPI_MASKED_WRITE_32BIT 0x0003u
889#define UWB2_SPI_BASE_ADDR_MASK 0x3E00u
890#define UWB2_SPI_SUB_ADDR_MASK 0x01FCu
891#define UWB2_SPI_MODE_MASK 0x0003u
897#define UWB2_WAIT_TIMEOUT_MS 5000u
907#define UWB2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
908#define UWB2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
926#define UWB2_MAP_MIKROBUS( cfg, mikrobus ) \
927 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
928 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
929 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
930 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
931 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_AN ); \
932 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
933 cfg.ext = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
934 cfg.irq = MIKROBUS( mikrobus, MIKROBUS_INT )
void uwb2_set_wup_pin(uwb2_t *ctx, uint8_t state)
UWB 2 set wup pin function.
err_t uwb2_send_cmd(uwb2_t *ctx, uint8_t cmd)
UWB 2 send cmd function.
err_t uwb2_read_reg_32bit(uwb2_t *ctx, uint16_t reg, uint32_t *data_out)
UWB 2 read register 32bit function.
err_t uwb2_initialize_ic(uwb2_t *ctx)
UWB 2 initialize IC function.
err_t uwb2_read_otp(uwb2_t *ctx, uint16_t address, uint32_t *data_out, uint16_t len)
UWB 2 read otp function.
err_t uwb2_read_message(uwb2_t *ctx, uint8_t *data_out, uint16_t *len)
UWB 2 read message function.
err_t uwb2_send_message(uwb2_t *ctx, uint8_t *data_in, uint16_t len)
UWB 2 send message function.
err_t uwb2_init(uwb2_t *ctx, uwb2_cfg_t *cfg)
UWB 2 initialization function.
err_t uwb2_clear_status(uwb2_t *ctx)
UWB 2 clear status function.
err_t uwb2_load_ic_rx_lut(uwb2_t *ctx, uint8_t channel)
UWB 2 load IC RX lut function.
err_t uwb2_set_ic_state(uwb2_t *ctx, uint8_t state)
UWB 2 set IC state function.
err_t uwb2_power_up_ic(uwb2_t *ctx)
UWB 2 power up IC function.
uint8_t uwb2_get_irq_pin(uwb2_t *ctx)
UWB 2 get irq pin function.
err_t uwb2_calibrate_ic_pgf(uwb2_t *ctx)
UWB 2 calibrate IC PGF function.
err_t uwb2_write_reg_8bit(uwb2_t *ctx, uint16_t reg, uint8_t data_in)
UWB 2 write register 8bit function.
err_t uwb2_read_reg_8bit(uwb2_t *ctx, uint16_t reg, uint8_t *data_out)
UWB 2 read register 8bit function.
err_t uwb2_set_rx_tx_leds(uwb2_t *ctx, uint8_t mode)
UWB 2 set RX TX LEDs function.
void uwb2_set_rst_pin(uwb2_t *ctx, uint8_t state)
UWB 2 set rst pin function.
err_t uwb2_write_reg_16bit(uwb2_t *ctx, uint16_t reg, uint16_t data_in)
UWB 2 write register 16bit function.
err_t uwb2_wait_for_status_lo(uwb2_t *ctx, uint32_t status)
UWB 2 wait for status lo function.
void uwb2_reset_device(uwb2_t *ctx)
UWB 2 reset device function.
err_t uwb2_configure_ic(uwb2_t *ctx, uwb2_chip_cfg_t *config)
UWB 2 configure IC function.
err_t uwb2_modify_reg_16bit(uwb2_t *ctx, uint16_t reg, uint16_t and_mask, uint16_t or_mask)
UWB 2 modify register 16bit function.
err_t uwb2_modify_reg_8bit(uwb2_t *ctx, uint16_t reg, uint8_t and_mask, uint8_t or_mask)
UWB 2 modify register 8bit function.
err_t uwb2_read_reg(uwb2_t *ctx, uint16_t reg, uint8_t *data_out, uint16_t len)
UWB 2 read register function.
err_t uwb2_check_communication(uwb2_t *ctx)
UWB 2 check communication function.
err_t uwb2_default_cfg(uwb2_t *ctx)
UWB 2 default configuration function.
err_t uwb2_read_reg_16bit(uwb2_t *ctx, uint16_t reg, uint16_t *data_out)
UWB 2 read register 16bit function.
uint8_t uwb2_get_ext_pin(uwb2_t *ctx)
UWB 2 get ext pin function.
err_t uwb2_write_reg_32bit(uwb2_t *ctx, uint16_t reg, uint32_t data_in)
UWB 2 write register 32bit function.
err_t uwb2_modify_reg_32bit(uwb2_t *ctx, uint16_t reg, uint32_t and_mask, uint32_t or_mask)
UWB 2 modify register 32bit function.
err_t uwb2_write_reg(uwb2_t *ctx, uint16_t reg, uint8_t *data_in, uint16_t len)
UWB 2 write register function.
void uwb2_cfg_setup(uwb2_cfg_t *cfg)
UWB 2 configuration object setup function.
This file contains SPI specific macros, functions, etc.
UWB 2 Click configuration object.
Definition uwb2.h:982
pin_name_t wup
Definition uwb2.h:990
pin_name_t irq
Definition uwb2.h:993
spi_master_chip_select_polarity_t cs_polarity
Definition uwb2.h:998
pin_name_t sck
Definition uwb2.h:986
spi_master_mode_t spi_mode
Definition uwb2.h:997
pin_name_t mosi
Definition uwb2.h:985
uint32_t spi_speed
Definition uwb2.h:996
pin_name_t miso
Definition uwb2.h:984
pin_name_t ext
Definition uwb2.h:992
pin_name_t rst
Definition uwb2.h:991
pin_name_t cs
Definition uwb2.h:987
UWB 2 Click chip configuration object.
Definition uwb2.h:944
uint8_t tx_plen
Definition uwb2.h:946
uint8_t channel
Definition uwb2.h:945
uint8_t sfd_type
Definition uwb2.h:950
uint8_t pac
Definition uwb2.h:947
uint8_t data_rate
Definition uwb2.h:951
uint8_t tx_code
Definition uwb2.h:948
uint16_t sfd_to
Definition uwb2.h:952
uint8_t rx_code
Definition uwb2.h:949
UWB 2 Click context object.
Definition uwb2.h:961
spi_master_t spi
Definition uwb2.h:971
digital_in_t irq
Definition uwb2.h:968
digital_out_t wup
Definition uwb2.h:963
digital_out_t rst
Definition uwb2.h:964
digital_in_t ext
Definition uwb2.h:967
pin_name_t chip_select
Definition uwb2.h:973
uwb2_return_value_t
UWB 2 Click return value data.
Definition uwb2.h:1007
@ UWB2_ERROR
Definition uwb2.h:1009
@ UWB2_OK
Definition uwb2.h:1008