RadioLib Universal wireless communication library for Arduino

TypeDef.h
1 #if !defined(_RADIOLIB_TYPES_H)
2 #define _RADIOLIB_TYPES_H
3
4 // user build options may override the default
5 #include "BuildOptUser.h"
6 #include "BuildOpt.h"
7
17 #define RADIOLIB_SHAPING_NONE (0x00)
18
22 #define RADIOLIB_SHAPING_0_3 (0x01)
23
27 #define RADIOLIB_SHAPING_0_5 (0x02)
28
32 #define RADIOLIB_SHAPING_0_7 (0x03)
33
37 #define RADIOLIB_SHAPING_1_0 (0x04)
38
52 #define RADIOLIB_ENCODING_NRZ (0x00)
53
57 #define RADIOLIB_ENCODING_MANCHESTER (0x01)
58
62 #define RADIOLIB_ENCODING_WHITENING (0x02)
63
77 #define RADIOLIB_STANDBY_DEFAULT (0x00)
78
82 #define RADIOLIB_STANDBY_WARM (0x01)
83
87 #define RADIOLIB_STANDBY_COLD (0x02)
88
99 // common status codes
100
104 #define RADIOLIB_ERR_NONE (0)
105
110 #define RADIOLIB_ERR_UNKNOWN (-1)
111
112 // SX127x/RFM9x status codes
113
118 #define RADIOLIB_ERR_CHIP_NOT_FOUND (-2)
119
123 #define RADIOLIB_ERR_MEMORY_ALLOCATION_FAILED (-3)
124
128 #define RADIOLIB_ERR_PACKET_TOO_LONG (-4)
129
133 #define RADIOLIB_ERR_TX_TIMEOUT (-5)
134
138 #define RADIOLIB_ERR_RX_TIMEOUT (-6)
139
144 #define RADIOLIB_ERR_CRC_MISMATCH (-7)
145
149 #define RADIOLIB_ERR_INVALID_BANDWIDTH (-8)
150
154 #define RADIOLIB_ERR_INVALID_SPREADING_FACTOR (-9)
155
159 #define RADIOLIB_ERR_INVALID_CODING_RATE (-10)
160
164 #define RADIOLIB_ERR_INVALID_BIT_RANGE (-11)
165
169 #define RADIOLIB_ERR_INVALID_FREQUENCY (-12)
170
174 #define RADIOLIB_ERR_INVALID_OUTPUT_POWER (-13)
175
180 #define RADIOLIB_PREAMBLE_DETECTED (-14)
181
185 #define RADIOLIB_CHANNEL_FREE (-15)
186
190 #define RADIOLIB_ERR_SPI_WRITE_FAILED (-16)
191
195 #define RADIOLIB_ERR_INVALID_CURRENT_LIMIT (-17)
196
200 #define RADIOLIB_ERR_INVALID_PREAMBLE_LENGTH (-18)
201
205 #define RADIOLIB_ERR_INVALID_GAIN (-19)
206
211 #define RADIOLIB_ERR_WRONG_MODEM (-20)
212
216 #define RADIOLIB_ERR_INVALID_NUM_SAMPLES (-21)
217
221 #define RADIOLIB_ERR_INVALID_RSSI_OFFSET (-22)
222
226 #define RADIOLIB_ERR_INVALID_ENCODING (-23)
227
231 #define RADIOLIB_ERR_LORA_HEADER_DAMAGED (-24)
232
236 #define RADIOLIB_ERR_UNSUPPORTED (-25)
237
241 #define RADIOLIB_ERR_INVALID_DIO_PIN (-26)
242
246 #define RADIOLIB_ERR_INVALID_RSSI_THRESHOLD (-27)
247
251 #define RADIOLIB_ERR_NULL_POINTER (-28)
252
253 // RF69-specific status codes
254
258 #define RADIOLIB_ERR_INVALID_BIT_RATE (-101)
259
263 #define RADIOLIB_ERR_INVALID_FREQUENCY_DEVIATION (-102)
264
268 #define RADIOLIB_ERR_INVALID_BIT_RATE_BW_RATIO (-103)
269
273 #define RADIOLIB_ERR_INVALID_RX_BANDWIDTH (-104)
274
278 #define RADIOLIB_ERR_INVALID_SYNC_WORD (-105)
279
283 #define RADIOLIB_ERR_INVALID_DATA_SHAPING (-106)
284
288 #define RADIOLIB_ERR_INVALID_MODULATION (-107)
289
293 #define RADIOLIB_ERR_INVALID_OOK_RSSI_PEAK_TYPE (-108)
294
295 // APRS status codes
296
300 #define RADIOLIB_ERR_INVALID_SYMBOL (-201)
301
305 #define RADIOLIB_ERR_INVALID_MIC_E_TELEMETRY (-202)
306
310 #define RADIOLIB_ERR_INVALID_MIC_E_TELEMETRY_LENGTH (-203)
311
315 #define RADIOLIB_ERR_MIC_E_TELEMETRY_STATUS (-204)
316
317 // SSDV status codes
318
322 #define RADIOLIB_ERR_INVALID_SSDV_MODE (-301)
323
327 #define RADIOLIB_ERR_INVALID_IMAGE_SIZE (-302)
328
332 #define RADIOLIB_ERR_INVALID_IMAGE_QUALITY (-303)
333
337 #define RADIOLIB_ERR_INVALID_SUBSAMPLING (-304)
338
339 // RTTY status codes
340
344 #define RADIOLIB_ERR_INVALID_RTTY_SHIFT (-401)
345
349 #define RADIOLIB_ERR_UNSUPPORTED_ENCODING (-402)
350
351 // nRF24-specific status codes
352
356 #define RADIOLIB_ERR_INVALID_DATA_RATE (-501)
357
361 #define RADIOLIB_ERR_INVALID_ADDRESS_WIDTH (-502)
362
366 #define RADIOLIB_ERR_INVALID_PIPE_NUMBER (-503)
367
371 #define RADIOLIB_ERR_ACK_NOT_RECEIVED (-504)
372
373 // CC1101-specific status codes
374
378 #define RADIOLIB_ERR_INVALID_NUM_BROAD_ADDRS (-601)
379
380 // SX126x-specific status codes
381
385 #define RADIOLIB_ERR_INVALID_CRC_CONFIGURATION (-701)
386
390 #define RADIOLIB_LORA_DETECTED (-702)
391
395 #define RADIOLIB_ERR_INVALID_TCXO_VOLTAGE (-703)
396
400 #define RADIOLIB_ERR_INVALID_MODULATION_PARAMETERS (-704)
401
405 #define RADIOLIB_ERR_SPI_CMD_TIMEOUT (-705)
406
410 #define RADIOLIB_ERR_SPI_CMD_INVALID (-706)
411
420 #define RADIOLIB_ERR_SPI_CMD_FAILED (-707)
421
428 #define RADIOLIB_ERR_INVALID_SLEEP_PERIOD (-708)
429
435 #define RADIOLIB_ERR_INVALID_RX_PERIOD (-709)
436
437 // AX.25-specific status codes
438
444 #define RADIOLIB_ERR_INVALID_CALLSIGN (-801)
445
451 #define RADIOLIB_ERR_INVALID_NUM_REPEATERS (-802)
452
458 #define RADIOLIB_ERR_INVALID_REPEATER_CALLSIGN (-803)
459
460 // SX128x-specific status codes
461
465 #define RADIOLIB_ERR_RANGING_TIMEOUT (-901)
466
467 // Pager-specific status codes
468
472 #define RADIOLIB_ERR_INVALID_PAYLOAD (-1001)
473
477 #define RADIOLIB_ERR_ADDRESS_NOT_FOUND (-1002)
478
483 #endif