acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
TypeDef.h (10802B)
1 #if !defined(_RADIOLIB_TYPES_H) 2 #define _RADIOLIB_TYPES_H 3 4 #include "BuildOpt.h" 5 6 /*! 7 \defgroup config_shaping Data shaping filter values aliases. 8 9 \{ 10 */ 11 12 /*! 13 \brief No shaping. 14 */ 15 #define RADIOLIB_SHAPING_NONE (0x00) 16 17 /*! 18 \brief Gaussin shaping filter, BT = 0.3 19 */ 20 #define RADIOLIB_SHAPING_0_3 (0x01) 21 22 /*! 23 \brief Gaussin shaping filter, BT = 0.5 24 */ 25 #define RADIOLIB_SHAPING_0_5 (0x02) 26 27 /*! 28 \brief Gaussin shaping filter, BT = 0.7 29 */ 30 #define RADIOLIB_SHAPING_0_7 (0x03) 31 32 /*! 33 \brief Gaussin shaping filter, BT = 1.0 34 */ 35 #define RADIOLIB_SHAPING_1_0 (0x04) 36 37 /*! 38 \} 39 */ 40 41 /*! 42 \defgroup config_encoding Encoding type aliases. 43 44 \{ 45 */ 46 47 /*! 48 \brief Non-return to zero - no encoding. 49 */ 50 #define RADIOLIB_ENCODING_NRZ (0x00) 51 52 /*! 53 \brief Manchester encoding. 54 */ 55 #define RADIOLIB_ENCODING_MANCHESTER (0x01) 56 57 /*! 58 \brief Whitening. 59 */ 60 #define RADIOLIB_ENCODING_WHITENING (0x02) 61 62 /*! 63 \} 64 */ 65 66 /*! 67 \defgroup status_codes Status Codes 68 69 \{ 70 */ 71 72 // common status codes 73 74 /*! 75 \brief No error, method executed successfully. 76 */ 77 #define RADIOLIB_ERR_NONE (0) 78 79 /*! 80 \brief There was an unexpected, unknown error. If you see this, something went incredibly wrong. 81 Your Arduino may be possessed, contact your local exorcist to resolve this error. 82 */ 83 #define RADIOLIB_ERR_UNKNOWN (-1) 84 85 // SX127x/RFM9x status codes 86 87 /*! 88 \brief Radio chip was not found during initialization. This can be caused by specifying wrong chip type in the constructor 89 (i.e. calling SX1272 constructor for SX1278 chip) or by a fault in your wiring (incorrect slave select pin). 90 */ 91 #define RADIOLIB_ERR_CHIP_NOT_FOUND (-2) 92 93 /*! 94 \brief Failed to allocate memory for temporary buffer. This can be cause by not enough RAM or by passing invalid pointer. 95 */ 96 #define RADIOLIB_ERR_MEMORY_ALLOCATION_FAILED (-3) 97 98 /*! 99 \brief Packet supplied to transmission method was longer than limit. 100 */ 101 #define RADIOLIB_ERR_PACKET_TOO_LONG (-4) 102 103 /*! 104 \brief Timed out waiting for transmission finish. 105 */ 106 #define RADIOLIB_ERR_TX_TIMEOUT (-5) 107 108 /*! 109 \brief Timed out waiting for incoming transmission. 110 */ 111 #define RADIOLIB_ERR_RX_TIMEOUT (-6) 112 113 /*! 114 \brief The calculated and expected CRCs of received packet do not match. 115 This means that the packet was damaged during transmission and should be sent again. 116 */ 117 #define RADIOLIB_ERR_CRC_MISMATCH (-7) 118 119 /*! 120 \brief The supplied bandwidth value is invalid for this module. 121 */ 122 #define RADIOLIB_ERR_INVALID_BANDWIDTH (-8) 123 124 /*! 125 \brief The supplied spreading factor value is invalid for this module. 126 */ 127 #define RADIOLIB_ERR_INVALID_SPREADING_FACTOR (-9) 128 129 /*! 130 \brief The supplied coding rate value is invalid for this module. 131 */ 132 #define RADIOLIB_ERR_INVALID_CODING_RATE (-10) 133 134 /*! 135 \brief Internal only. 136 */ 137 #define RADIOLIB_ERR_INVALID_BIT_RANGE (-11) 138 139 /*! 140 \brief The supplied frequency value is invalid for this module. 141 */ 142 #define RADIOLIB_ERR_INVALID_FREQUENCY (-12) 143 144 /*! 145 \brief The supplied output power value is invalid for this module. 146 */ 147 #define RADIOLIB_ERR_INVALID_OUTPUT_POWER (-13) 148 149 /*! 150 \brief LoRa preamble was detected during channel activity detection. 151 This means that there is some LoRa device currently transmitting in your channel. 152 */ 153 #define RADIOLIB_PREAMBLE_DETECTED (-14) 154 155 /*! 156 \brief No LoRa preambles were detected during channel activity detection. Your channel is free. 157 */ 158 #define RADIOLIB_CHANNEL_FREE (-15) 159 160 /*! 161 \brief Real value in SPI register does not match the expected one. This can be caused by faulty SPI wiring. 162 */ 163 #define RADIOLIB_ERR_SPI_WRITE_FAILED (-16) 164 165 /*! 166 \brief The supplied current limit value is invalid. 167 */ 168 #define RADIOLIB_ERR_INVALID_CURRENT_LIMIT (-17) 169 170 /*! 171 \brief The supplied preamble length is invalid. 172 */ 173 #define RADIOLIB_ERR_INVALID_PREAMBLE_LENGTH (-18) 174 175 /*! 176 \brief The supplied gain value is invalid. 177 */ 178 #define RADIOLIB_ERR_INVALID_GAIN (-19) 179 180 /*! 181 \brief User tried to execute modem-exclusive method on a wrong modem. 182 For example, this can happen when you try to change LoRa configuration when FSK modem is active. 183 */ 184 #define RADIOLIB_ERR_WRONG_MODEM (-20) 185 186 /*! 187 \brief The supplied number of RSSI samples is invalid. 188 */ 189 #define RADIOLIB_ERR_INVALID_NUM_SAMPLES (-21) 190 191 /*! 192 \brief The supplied RSSI offset is invalid. 193 */ 194 #define RADIOLIB_ERR_INVALID_RSSI_OFFSET (-22) 195 196 /*! 197 \brief The supplied encoding is invalid. 198 */ 199 #define RADIOLIB_ERR_INVALID_ENCODING (-23) 200 201 /*! 202 \brief LoRa packet header has been damaged. 203 */ 204 #define RADIOLIB_ERR_LORA_HEADER_DAMAGED (-24) 205 206 /*! 207 \brief The requested functionality is not supported for this device 208 */ 209 #define RADIOLIB_ERR_UNSUPPORTED (-25) 210 211 /*! 212 \brief The specified DIO pin does not exist on this device 213 */ 214 #define RADIOLIB_ERR_INVALID_DIO_PIN (-26) 215 216 /*! 217 \brief The supplied RSSI threshold is invalid. 218 */ 219 #define RADIOLIB_ERR_INVALID_RSSI_THRESHOLD (-27) 220 221 // RF69-specific status codes 222 223 /*! 224 \brief The supplied bit rate value is invalid. 225 */ 226 #define RADIOLIB_ERR_INVALID_BIT_RATE (-101) 227 228 /*! 229 \brief The supplied frequency deviation value is invalid. 230 */ 231 #define RADIOLIB_ERR_INVALID_FREQUENCY_DEVIATION (-102) 232 233 /*! 234 \brief The supplied bit rate to bandwidth ratio is invalid. See the module datasheet for more information. 235 */ 236 #define RADIOLIB_ERR_INVALID_BIT_RATE_BW_RATIO (-103) 237 238 /*! 239 \brief The supplied receiver bandwidth value is invalid. 240 */ 241 #define RADIOLIB_ERR_INVALID_RX_BANDWIDTH (-104) 242 243 /*! 244 \brief The supplied FSK sync word is invalid. 245 */ 246 #define RADIOLIB_ERR_INVALID_SYNC_WORD (-105) 247 248 /*! 249 \brief The supplied FSK data shaping option is invalid. 250 */ 251 #define RADIOLIB_ERR_INVALID_DATA_SHAPING (-106) 252 253 /*! 254 \brief The current modulation is invalid for the requested operation. 255 */ 256 #define RADIOLIB_ERR_INVALID_MODULATION (-107) 257 258 /*! 259 \brief Supplied Peak type is invalid. 260 */ 261 #define RADIOLIB_ERR_INVALID_OOK_RSSI_PEAK_TYPE (-108) 262 263 // APRS status codes 264 265 /*! 266 \brief Supplied APRS symbol is invalid. 267 */ 268 #define RADIOLIB_ERR_INVALID_SYMBOL (-201) 269 270 /*! 271 \brief Mic-E Telemetry is invalid. 272 */ 273 #define RADIOLIB_ERR_INVALID_MIC_E_TELEMETRY (-202) 274 275 /*! 276 \brief Mic-E Telemetry length is invalid (only 0, 2 or 5 is allowed). 277 */ 278 #define RADIOLIB_ERR_INVALID_MIC_E_TELEMETRY_LENGTH (-203) 279 280 /*! 281 \brief Mic-E message cannot contaion both telemetry and status text. 282 */ 283 #define RADIOLIB_ERR_MIC_E_TELEMETRY_STATUS (-204) 284 285 // RTTY status codes 286 287 /*! 288 \brief Supplied RTTY frequency shift is invalid for this module. 289 */ 290 #define RADIOLIB_ERR_INVALID_RTTY_SHIFT (-401) 291 292 /*! 293 \brief Supplied RTTY encoding is invalid. 294 */ 295 #define RADIOLIB_ERR_UNSUPPORTED_ENCODING (-402) 296 297 // nRF24-specific status codes 298 299 /*! 300 \brief Supplied data rate is invalid. 301 */ 302 #define RADIOLIB_ERR_INVALID_DATA_RATE (-501) 303 304 /*! 305 \brief Supplied address width is invalid. 306 */ 307 #define RADIOLIB_ERR_INVALID_ADDRESS_WIDTH (-502) 308 309 /*! 310 \brief Supplied data pipe number is invalid. 311 */ 312 #define RADIOLIB_ERR_INVALID_PIPE_NUMBER (-503) 313 314 /*! 315 \brief ACK packet from destination module was not received within 15 retries. 316 */ 317 #define RADIOLIB_ERR_ACK_NOT_RECEIVED (-504) 318 319 // CC1101-specific status codes 320 321 /*! 322 \brief Supplied number of broadcast addresses is invalid. 323 */ 324 #define RADIOLIB_ERR_INVALID_NUM_BROAD_ADDRS (-601) 325 326 // SX126x-specific status codes 327 328 /*! 329 \brief Supplied CRC configuration is invalid. 330 */ 331 #define RADIOLIB_ERR_INVALID_CRC_CONFIGURATION (-701) 332 333 /*! 334 \brief Detected LoRa transmission while scanning channel. 335 */ 336 #define RADIOLIB_LORA_DETECTED (-702) 337 338 /*! 339 \brief Supplied TCXO reference voltage is invalid. 340 */ 341 #define RADIOLIB_ERR_INVALID_TCXO_VOLTAGE (-703) 342 343 /*! 344 \brief Bit rate / bandwidth / frequency deviation ratio is invalid. See SX126x datasheet for details. 345 */ 346 #define RADIOLIB_ERR_INVALID_MODULATION_PARAMETERS (-704) 347 348 /*! 349 \brief SX126x timed out while waiting for complete SPI command. 350 */ 351 #define RADIOLIB_ERR_SPI_CMD_TIMEOUT (-705) 352 353 /*! 354 \brief SX126x received invalid SPI command. 355 */ 356 #define RADIOLIB_ERR_SPI_CMD_INVALID (-706) 357 358 /*! 359 \brief SX126x failed to execute SPI command. 360 */ 361 #define RADIOLIB_ERR_SPI_CMD_FAILED (-707) 362 363 /*! 364 \brief The supplied sleep period is invalid. 365 366 The specified sleep period is shorter than the time necessary to sleep and wake the hardware 367 including TCXO delay, or longer than the maximum possible 368 */ 369 #define RADIOLIB_ERR_INVALID_SLEEP_PERIOD (-708) 370 371 /*! 372 \brief The supplied Rx period is invalid. 373 374 The specified Rx period is shorter or longer than the hardware can handle. 375 */ 376 #define RADIOLIB_ERR_INVALID_RX_PERIOD (-709) 377 378 // AX.25-specific status codes 379 380 /*! 381 \brief The provided callsign is invalid. 382 383 The specified callsign is longer than 6 ASCII characters. 384 */ 385 #define RADIOLIB_ERR_INVALID_CALLSIGN (-801) 386 387 /*! 388 \brief The provided repeater configuration is invalid. 389 390 The specified number of repeaters does not match number of repeater IDs or their callsigns. 391 */ 392 #define RADIOLIB_ERR_INVALID_NUM_REPEATERS (-802) 393 394 /*! 395 \brief One of the provided repeater callsigns is invalid. 396 397 The specified callsign is longer than 6 ASCII characters. 398 */ 399 #define RADIOLIB_ERR_INVALID_REPEATER_CALLSIGN (-803) 400 401 // SX128x-specific status codes 402 403 /*! 404 \brief Timed out waiting for ranging exchange finish. 405 */ 406 #define RADIOLIB_ERR_RANGING_TIMEOUT (-901) 407 408 /*! 409 \} 410 */ 411 412 #endif