2021-03-13 18:06:04 +00:00
|
|
|
#if !defined(_RADIOLIB_TYPES_H)
|
2019-02-08 14:58:29 +00:00
|
|
|
#define _RADIOLIB_TYPES_H
|
2020-01-02 13:48:53 +00:00
|
|
|
|
2020-03-29 08:02:23 +00:00
|
|
|
#include "BuildOpt.h"
|
2020-01-13 15:36:21 +00:00
|
|
|
|
2020-07-06 06:51:24 +00:00
|
|
|
/*!
|
|
|
|
\defgroup config_shaping Data shaping filter values aliases.
|
|
|
|
|
|
|
|
\{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief No shaping.
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_SHAPING_NONE (0x00)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Gaussin shaping filter, BT = 0.3
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_SHAPING_0_3 (0x01)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Gaussin shaping filter, BT = 0.5
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_SHAPING_0_5 (0x02)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Gaussin shaping filter, BT = 0.7
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_SHAPING_0_7 (0x03)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Gaussin shaping filter, BT = 1.0
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_SHAPING_1_0 (0x04)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\defgroup config_encoding Encoding type aliases.
|
|
|
|
|
|
|
|
\{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Non-return to zero - no encoding.
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_ENCODING_NRZ (0x00)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Manchester encoding.
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_ENCODING_MANCHESTER (0x01)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Whitening.
|
|
|
|
*/
|
2021-11-14 13:03:32 +00:00
|
|
|
#define RADIOLIB_ENCODING_WHITENING (0x02)
|
2020-07-06 06:51:24 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\}
|
|
|
|
*/
|
|
|
|
|
2019-05-24 15:32:11 +00:00
|
|
|
/*!
|
|
|
|
\defgroup status_codes Status Codes
|
|
|
|
|
|
|
|
\{
|
|
|
|
*/
|
|
|
|
|
|
|
|
// common status codes
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief No error, method executed successfully.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_NONE (0)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief There was an unexpected, unknown error. If you see this, something went incredibly wrong.
|
|
|
|
Your Arduino may be possessed, contact your local exorcist to resolve this error.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_UNKNOWN (-1)
|
2018-03-05 16:08:42 +00:00
|
|
|
|
2019-05-24 15:32:11 +00:00
|
|
|
// SX127x/RFM9x status codes
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Radio chip was not found during initialization. This can be caused by specifying wrong chip type in the constructor
|
|
|
|
(i.e. calling SX1272 constructor for SX1278 chip) or by a fault in your wiring (incorrect slave select pin).
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_CHIP_NOT_FOUND (-2)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
2019-06-16 12:33:26 +00:00
|
|
|
\brief Failed to allocate memory for temporary buffer. This can be cause by not enough RAM or by passing invalid pointer.
|
2019-05-24 15:32:11 +00:00
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_MEMORY_ALLOCATION_FAILED (-3)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Packet supplied to transmission method was longer than limit.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_PACKET_TOO_LONG (-4)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Timed out waiting for transmission finish.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_TX_TIMEOUT (-5)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Timed out waiting for incoming transmission.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_RX_TIMEOUT (-6)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The calculated and expected CRCs of received packet do not match.
|
|
|
|
This means that the packet was damaged during transmission and should be sent again.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_CRC_MISMATCH (-7)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied bandwidth value is invalid for this module.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_BANDWIDTH (-8)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied spreading factor value is invalid for this module.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_SPREADING_FACTOR (-9)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied coding rate value is invalid for this module.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_CODING_RATE (-10)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Internal only.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_BIT_RANGE (-11)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied frequency value is invalid for this module.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_FREQUENCY (-12)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied output power value is invalid for this module.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_OUTPUT_POWER (-13)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief LoRa preamble was detected during channel activity detection.
|
|
|
|
This means that there is some LoRa device currently transmitting in your channel.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_PREAMBLE_DETECTED (-14)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief No LoRa preambles were detected during channel activity detection. Your channel is free.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_CHANNEL_FREE (-15)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Real value in SPI register does not match the expected one. This can be caused by faulty SPI wiring.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_SPI_WRITE_FAILED (-16)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied current limit value is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_CURRENT_LIMIT (-17)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied preamble length is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_PREAMBLE_LENGTH (-18)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied gain value is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_GAIN (-19)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief User tried to execute modem-exclusive method on a wrong modem.
|
|
|
|
For example, this can happen when you try to change LoRa configuration when FSK modem is active.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_WRONG_MODEM (-20)
|
2018-07-14 06:43:04 +00:00
|
|
|
|
2019-11-19 16:08:59 +00:00
|
|
|
/*!
|
|
|
|
\brief The supplied number of RSSI samples is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_NUM_SAMPLES (-21)
|
2019-11-19 16:08:59 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied RSSI offset is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_RSSI_OFFSET (-22)
|
2019-11-19 16:08:59 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied encoding is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_ENCODING (-23)
|
2019-11-19 16:08:59 +00:00
|
|
|
|
2020-11-19 16:07:32 +00:00
|
|
|
/*!
|
|
|
|
\brief LoRa packet header has been damaged.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_LORA_HEADER_DAMAGED (-24)
|
2020-11-19 16:07:32 +00:00
|
|
|
|
2018-07-14 06:43:04 +00:00
|
|
|
// RF69-specific status codes
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied bit rate value is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_BIT_RATE (-101)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied frequency deviation value is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_FREQUENCY_DEVIATION (-102)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied bit rate to bandwidth ratio is invalid. See the module datasheet for more information.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_BIT_RATE_BW_RATIO (-103)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied receiver bandwidth value is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_RX_BANDWIDTH (-104)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied FSK sync word is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_SYNC_WORD (-105)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied FSK data shaping option is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_DATA_SHAPING (-106)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The current modulation is invalid for the requested operation.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_MODULATION (-107)
|
2018-03-05 16:08:42 +00:00
|
|
|
|
2021-03-24 17:05:32 +00:00
|
|
|
/*!
|
|
|
|
\brief Supplied Peak type is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_OOK_RSSI_PEAK_TYPE (-108)
|
2018-03-05 16:08:42 +00:00
|
|
|
|
2021-11-28 21:56:36 +00:00
|
|
|
// APRS status codes
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied APRS symbol is invalid.
|
|
|
|
*/
|
|
|
|
#define RADIOLIB_ERR_INVALID_SYMBOL (-201)
|
|
|
|
|
2018-10-02 18:46:52 +00:00
|
|
|
// RTTY status codes
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied RTTY frequency shift is invalid for this module.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_RTTY_SHIFT (-401)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied RTTY encoding is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_UNSUPPORTED_ENCODING (-402)
|
2018-10-02 18:46:52 +00:00
|
|
|
|
2019-06-01 18:50:43 +00:00
|
|
|
// nRF24-specific status codes
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied data rate is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_DATA_RATE (-501)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied address width is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_ADDRESS_WIDTH (-502)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied data pipe number is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_PIPE_NUMBER (-503)
|
2019-02-23 08:36:56 +00:00
|
|
|
|
2019-06-01 18:50:43 +00:00
|
|
|
/*!
|
|
|
|
\brief ACK packet from destination module was not received within 15 retries.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_ACK_NOT_RECEIVED (-504)
|
2019-06-01 18:50:43 +00:00
|
|
|
|
2019-02-09 16:45:04 +00:00
|
|
|
// CC1101-specific status codes
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied number of broadcast addresses is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_NUM_BROAD_ADDRS (-601)
|
2019-02-09 16:45:04 +00:00
|
|
|
|
2019-05-18 11:27:43 +00:00
|
|
|
// SX126x-specific status codes
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied CRC configuration is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_CRC_CONFIGURATION (-701)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Detected LoRa transmission while scanning channel.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_LORA_DETECTED (-702)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Supplied TCXO reference voltage is invalid.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_TCXO_VOLTAGE (-703)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Bit rate / bandwidth / frequency deviation ratio is invalid. See SX126x datasheet for details.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_MODULATION_PARAMETERS (-704)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief SX126x timed out while waiting for complete SPI command.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_SPI_CMD_TIMEOUT (-705)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief SX126x received invalid SPI command.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_SPI_CMD_INVALID (-706)
|
2019-05-24 15:32:11 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief SX126x failed to execute SPI command.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_SPI_CMD_FAILED (-707)
|
2019-05-18 11:27:43 +00:00
|
|
|
|
2019-12-05 13:38:02 +00:00
|
|
|
/*!
|
|
|
|
\brief The supplied sleep period is invalid.
|
|
|
|
|
|
|
|
The specified sleep period is shorter than the time necessary to sleep and wake the hardware
|
|
|
|
including TCXO delay, or longer than the maximum possible
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_SLEEP_PERIOD (-708)
|
2019-12-05 13:38:02 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The supplied Rx period is invalid.
|
|
|
|
|
|
|
|
The specified Rx period is shorter or longer than the hardware can handle.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_RX_PERIOD (-709)
|
2019-12-05 13:38:02 +00:00
|
|
|
|
2020-02-14 07:08:59 +00:00
|
|
|
// AX.25-specific status codes
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The provided callsign is invalid.
|
|
|
|
|
|
|
|
The specified callsign is longer than 6 ASCII characters.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_CALLSIGN (-801)
|
2020-02-14 07:08:59 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief The provided repeater configuration is invalid.
|
|
|
|
|
|
|
|
The specified number of repeaters does not match number of repeater IDs or their callsigns.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_NUM_REPEATERS (-802)
|
2020-02-14 07:08:59 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief One of the provided repeater callsigns is invalid.
|
|
|
|
|
|
|
|
The specified callsign is longer than 6 ASCII characters.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_INVALID_REPEATER_CALLSIGN (-803)
|
2020-02-14 07:08:59 +00:00
|
|
|
|
2020-04-12 11:47:56 +00:00
|
|
|
// SX128x-specific status codes
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Timed out waiting for ranging exchange finish.
|
|
|
|
*/
|
2021-11-14 10:36:06 +00:00
|
|
|
#define RADIOLIB_ERR_RANGING_TIMEOUT (-901)
|
2020-04-12 11:47:56 +00:00
|
|
|
|
2019-05-24 15:32:11 +00:00
|
|
|
/*!
|
|
|
|
\}
|
|
|
|
*/
|
|
|
|
|
2018-03-05 16:08:42 +00:00
|
|
|
#endif
|