Go to the source code of this file.
◆ XL2400_CarrierTest()
| void XL2400_CarrierTest |
( |
void |
| ) |
|
Definition at line 343 of file xl2400.c.
344{
347 *(
xbuf + 12) |= 0x40;
348 *(
xbuf + 4) &= ~0x04;
355}
void XL2400_WriteReg(uint8_t reg, uint8_t value)
void XL2400_WriteFromBuf(uint8_t reg, const uint8_t *pBuf, uint8_t len)
void XL2400_ReadToBuf(uint8_t reg, uint8_t *pBuf, uint8_t len)
__IDATA uint8_t xbuf[XL2400_PL_WIDTH_MAX+1]
void XL2400_ClearStatus(void)
#define XL2400_REG_TXPROC_CFG
#define XL2400_REG_ANALOG_CFG0
#define XL2400_CMD_R_REGISTER
#define XL2400_CMD_W_REGISTER
#define XL2400_REG_RF_SETUP
◆ XL2400_CE_High()
| void XL2400_CE_High |
( |
void |
| ) |
|
Definition at line 121 of file xl2400.c.
122{
126}
#define XL2400_REG_CFG_TOP
◆ XL2400_CE_Low()
| void XL2400_CE_Low |
( |
void |
| ) |
|
◆ XL2400_ClearStatus()
| void XL2400_ClearStatus |
( |
void |
| ) |
|
Definition at line 330 of file xl2400.c.
331{
335}
#define XL2400_CMD_FLUSH_TX
#define XL2400_CMD_FLUSH_RX
#define XL2400_REG_STATUS
◆ XL2400_FlushRxTX()
| void XL2400_FlushRxTX |
( |
void |
| ) |
|
◆ XL2400_Init()
| void XL2400_Init |
( |
void |
| ) |
|
Definition at line 141 of file xl2400.c.
142{
143
145 *(
xbuf + 4) &= ~0x04;
146 *(
xbuf + 12) |= 0x40;
148
150
152
154
156
158
160
164
166
167
168
169
170
171
172
173
175
179}
#define XL2400_REG_EN_RXADDR
#define XL2400_REG_FEATURE
#define XL2400_PLOAD_WIDTH
#define XL2400_REG_SETUP_RETR
#define XL2400_REG_SETUP_AW
#define XL2400_REG_RX_PW_PX
◆ XL2400_PrintStatus()
| uint8_t XL2400_PrintStatus |
( |
void |
| ) |
|
Definition at line 357 of file xl2400.c.
358{
360
361 UART1_TxString(
"Bytes from low to high: 0,1,2,3,...\r\n[Config]");
363 for (
i = 0;
i < 3;
i++) {
365 }
366
369
372
375
378 for (
i = 0;
i < 4;
i++) {
380 }
381
384 for (
i = 0;
i < 3;
i++) {
386 }
387
390 for (
i = 0;
i < 2;
i++) {
392 }
393
396 for (
i = 0;
i < 4;
i++) {
398 }
399
402 for (
i = 0;
i < 2;
i++) {
404 }
405
408 for (
i = 0;
i < 5;
i++) {
410 }
411
414 for (
i = 0;
i < 5;
i++) {
416 }
419 for (
i = 0;
i < 5;
i++) {
421 }
424 for (
i = 0;
i < 4;
i++) {
426 }
427
430 for (
i = 0;
i < 6;
i++) {
432 }
433
436 for (
i = 0;
i < 3;
i++) {
438 }
443
448 return status;
449}
void UART1_TxString(uint8_t *str)
void UART1_TxHex(uint8_t hex)
uint8_t XL2400_ReadStatus(void)
uint8_t XL2400_ReadReg(uint8_t reg)
#define XL2400_REG_RX_ADDR_P0
#define XL2400_REG_OBSERVE_TX
#define XL2400_REG_FIFO_STATUS
#define XL2400_REG_RX_ADDR_P1
#define XL2400_REG_RX_ADDR_P2_P5
#define XL2400_REG_TX_ADDR
◆ XL2400_ReadByte()
Emulate SPI Read on GPIO pins
Definition at line 48 of file xl2400.c.
49{
51
54 for (
i = 0;
i < 8;
i++)
55 {
56 RxData = RxData << 1;
59 {
60 RxData |= 0x01;
61 }
62 else
63 {
64 RxData &= 0xfe;
65 }
67 }
69 return RxData;
70}
#define XL2400_CLK_HIGH()
#define XL2400_DATA_READ()
◆ XL2400_ReadReg()
Definition at line 80 of file xl2400.c.
81{
87 return reg_val;
88}
void XL2400_WriteByte(uint8_t value)
uint8_t XL2400_ReadByte(void)
#define XL2400_NSS_HIGH()
◆ XL2400_ReadStatus()
◆ XL2400_ReadToBuf()
Definition at line 102 of file xl2400.c.
103{
107 for (ctr = 0; ctr < len; ctr++)
108 {
110 }
112}
◆ XL2400_Rx()
Definition at line 306 of file xl2400.c.
307{
311 {
316
317
318
319
320
321 }
322 return status;
323}
#define XL2400_CMD_R_RX_PAYLOAD
#define XL2400_CMD_R_RX_PL_WID
◆ XL2400_RxCalibrate()
| uint8_t XL2400_RxCalibrate |
( |
void |
| ) |
|
Definition at line 236 of file xl2400.c.
237{
239 for (
i = 0;
i < 10;
i++)
240 {
244 *(
cbuf + 1) &= ~0x20;
250
251 if (*(
cbuf + 1) & 0x20)
252 {
253 j = *(
cbuf + 1) << 3;
261 }
262 }
264}
void SYS_Delay(uint16_t t)
#define XL2400_REG_ANALOG_CFG3
◆ XL2400_SetChannel()
| void XL2400_SetChannel |
( |
uint8_t |
channel | ) |
|
Definition at line 181 of file xl2400.c.
182{
183 if (channel > 80) channel = 80;
184
186
188
189 *(
cbuf + 0) = 0x60 + channel;
192
195}
◆ XL2400_SetPower()
| void XL2400_SetPower |
( |
uint8_t |
power | ) |
|
◆ XL2400_SetRxAddress()
| void XL2400_SetRxAddress |
( |
uint8_t * |
address | ) |
|
◆ XL2400_SetRxMode()
| void XL2400_SetRxMode |
( |
void |
| ) |
|
Definition at line 275 of file xl2400.c.
276{
280
283}
void XL2400_CE_High(void)
◆ XL2400_SetTxAddress()
| void XL2400_SetTxAddress |
( |
uint8_t * |
address | ) |
|
◆ XL2400_SetTxMode()
| void XL2400_SetTxMode |
( |
void |
| ) |
|
Definition at line 266 of file xl2400.c.
267{
273}
uint8_t XL2400_RxCalibrate(void)
◆ XL2400_Sleep()
| void XL2400_Sleep |
( |
void |
| ) |
|
◆ XL2400_SPI_Test()
Definition at line 128 of file xl2400.c.
129{
134 for (
i = 0;
i < 5;
i++) {
137 }
139}
◆ XL2400_Tx()
Definition at line 285 of file xl2400.c.
286{
291
293 {
296
298 {
299 break;
300 }
301 }
303 return status;
304}
void SYS_DelayUs(uint16_t t)
#define XL2400_CMD_W_TX_PAYLOAD
◆ XL2400_WakeUp()
| void XL2400_WakeUp |
( |
void |
| ) |
|
◆ XL2400_WriteByte()
| void XL2400_WriteByte |
( |
uint8_t |
value | ) |
|
Emulate SPI Write on GPIO pins
Definition at line 23 of file xl2400.c.
24{
28 for (
i = 0;
i < 8;
i++)
29 {
32 {
34 }
35 else
36 {
38 }
41 }
43}
#define XL2400_DATA_OUT()
#define XL2400_DATA_HIGH()
#define XL2400_DATA_LOW()
◆ XL2400_WriteFromBuf()
Definition at line 90 of file xl2400.c.
91{
95 for (ctr = 0; ctr < len; ctr++)
96 {
98 }
100}
◆ XL2400_WriteReg()
◆ cbuf
◆ xbuf