[SX128x] General reformatting
This commit is contained in:
parent
d4365a3b1e
commit
76c654c0c1
6 changed files with 601 additions and 723 deletions
|
@ -12,10 +12,10 @@ int16_t SX1280::range(bool master, uint32_t addr, uint16_t calTable[3][6]) {
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// wait until ranging is finished
|
// wait until ranging is finished
|
||||||
uint32_t start = _mod->hal->millis();
|
uint32_t start = this->mod->hal->millis();
|
||||||
while(!_mod->hal->digitalRead(_mod->getIrq())) {
|
while(!this->mod->hal->digitalRead(this->mod->getIrq())) {
|
||||||
_mod->hal->yield();
|
this->mod->hal->yield();
|
||||||
if(_mod->hal->millis() - start > 10000) {
|
if(this->mod->hal->millis() - start > 10000) {
|
||||||
clearIrqStatus();
|
clearIrqStatus();
|
||||||
standby();
|
standby();
|
||||||
return(RADIOLIB_ERR_RANGING_TIMEOUT);
|
return(RADIOLIB_ERR_RANGING_TIMEOUT);
|
||||||
|
@ -50,11 +50,11 @@ int16_t SX1280::startRanging(bool master, uint32_t addr, uint16_t calTable[3][6]
|
||||||
}
|
}
|
||||||
|
|
||||||
// set modulation parameters
|
// set modulation parameters
|
||||||
state = setModulationParams(_sf, _bw, _cr);
|
state = setModulationParams(this->spreadingFactor, this->bandwidth, this->codingRateLoRa);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// set packet parameters
|
// set packet parameters
|
||||||
state = setPacketParamsLoRa(_preambleLengthLoRa, _headerType, _payloadLen, _crcLoRa);
|
state = setPacketParamsLoRa(this->preambleLengthLoRa, this->headerType, this->payloadLen, this->crcLoRa);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// check all address bits
|
// check all address bits
|
||||||
|
@ -100,9 +100,9 @@ int16_t SX1280::startRanging(bool master, uint32_t addr, uint16_t calTable[3][6]
|
||||||
}
|
}
|
||||||
|
|
||||||
// set calibration values
|
// set calibration values
|
||||||
uint8_t index = (_sf >> 4) - 5;
|
uint8_t index = (this->spreadingFactor >> 4) - 5;
|
||||||
uint16_t val = 0;
|
uint16_t val = 0;
|
||||||
switch(_bw) {
|
switch(this->bandwidth) {
|
||||||
case(RADIOLIB_SX128X_LORA_BW_406_25):
|
case(RADIOLIB_SX128X_LORA_BW_406_25):
|
||||||
val = calTbl[0][index];
|
val = calTbl[0][index];
|
||||||
break;
|
break;
|
||||||
|
@ -176,7 +176,7 @@ float SX1280::getRangingResult() {
|
||||||
|
|
||||||
// calculate the real result
|
// calculate the real result
|
||||||
uint32_t raw = ((uint32_t)data[0] << 16) | ((uint32_t)data[1] << 8) | data[2];
|
uint32_t raw = ((uint32_t)data[0] << 16) | ((uint32_t)data[1] << 8) | data[2];
|
||||||
return((float)raw * 150.0 / (4.096 * _bwKhz));
|
return((float)raw * 150.0 / (4.096 * this->bandwidthKhz));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,47 +11,36 @@
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class SX1280
|
\class SX1280
|
||||||
|
|
||||||
\brief Derived class for %SX1280 modules.
|
\brief Derived class for %SX1280 modules.
|
||||||
*/
|
*/
|
||||||
class SX1280: public SX1281 {
|
class SX1280: public SX1281 {
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
\brief Default constructor.
|
\brief Default constructor.
|
||||||
|
|
||||||
\param mod Instance of Module that will be used to communicate with the radio.
|
\param mod Instance of Module that will be used to communicate with the radio.
|
||||||
*/
|
*/
|
||||||
SX1280(Module* mod);
|
SX1280(Module* mod);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Blocking ranging method.
|
\brief Blocking ranging method.
|
||||||
|
|
||||||
\param master Whether to execute ranging in master mode (true) or slave mode (false).
|
\param master Whether to execute ranging in master mode (true) or slave mode (false).
|
||||||
|
|
||||||
\param addr Ranging address to be used.
|
\param addr Ranging address to be used.
|
||||||
|
|
||||||
\param calTable Ranging calibration table - set to NULL to use the default.
|
\param calTable Ranging calibration table - set to NULL to use the default.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t range(bool master, uint32_t addr, uint16_t calTable[3][6] = NULL);
|
int16_t range(bool master, uint32_t addr, uint16_t calTable[3][6] = NULL);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Interrupt-driven ranging method.
|
\brief Interrupt-driven ranging method.
|
||||||
|
|
||||||
\param master Whether to execute ranging in master mode (true) or slave mode (false).
|
\param master Whether to execute ranging in master mode (true) or slave mode (false).
|
||||||
|
|
||||||
\param addr Ranging address to be used.
|
\param addr Ranging address to be used.
|
||||||
|
|
||||||
\param calTable Ranging calibration table - set to NULL to use the default.
|
\param calTable Ranging calibration table - set to NULL to use the default.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t startRanging(bool master, uint32_t addr, uint16_t calTable[3][6] = NULL);
|
int16_t startRanging(bool master, uint32_t addr, uint16_t calTable[3][6] = NULL);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Gets ranging result of the last ranging exchange.
|
\brief Gets ranging result of the last ranging exchange.
|
||||||
|
|
||||||
\returns Ranging result in meters.
|
\returns Ranging result in meters.
|
||||||
*/
|
*/
|
||||||
float getRangingResult();
|
float getRangingResult();
|
||||||
|
|
|
@ -10,14 +10,12 @@
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class SX1281
|
\class SX1281
|
||||||
|
|
||||||
\brief Derived class for %SX1281 modules.
|
\brief Derived class for %SX1281 modules.
|
||||||
*/
|
*/
|
||||||
class SX1281: public SX128x {
|
class SX1281: public SX128x {
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
\brief Default constructor.
|
\brief Default constructor.
|
||||||
|
|
||||||
\param mod Instance of Module that will be used to communicate with the radio.
|
\param mod Instance of Module that will be used to communicate with the radio.
|
||||||
*/
|
*/
|
||||||
SX1281(Module* mod);
|
SX1281(Module* mod);
|
||||||
|
|
|
@ -11,14 +11,12 @@
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class SX1282
|
\class SX1282
|
||||||
|
|
||||||
\brief Derived class for %SX1282 modules.
|
\brief Derived class for %SX1282 modules.
|
||||||
*/
|
*/
|
||||||
class SX1282: public SX1280 {
|
class SX1282: public SX1280 {
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
\brief Default constructor.
|
\brief Default constructor.
|
||||||
|
|
||||||
\param mod Instance of Module that will be used to communicate with the radio.
|
\param mod Instance of Module that will be used to communicate with the radio.
|
||||||
*/
|
*/
|
||||||
SX1282(Module* mod);
|
SX1282(Module* mod);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -344,7 +344,6 @@
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class SX128x
|
\class SX128x
|
||||||
|
|
||||||
\brief Base class for %SX128x series. All derived classes for %SX128x (e.g. SX1280 or SX1281) inherit from this base class.
|
\brief Base class for %SX128x series. All derived classes for %SX128x (e.g. SX1280 or SX1281) inherit from this base class.
|
||||||
This class should not be instantiated directly from Arduino sketch, only from its derived classes.
|
This class should not be instantiated directly from Arduino sketch, only from its derived classes.
|
||||||
*/
|
*/
|
||||||
|
@ -358,7 +357,6 @@ class SX128x: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Default constructor.
|
\brief Default constructor.
|
||||||
|
|
||||||
\param mod Instance of Module that will be used to communicate with the radio.
|
\param mod Instance of Module that will be used to communicate with the radio.
|
||||||
*/
|
*/
|
||||||
SX128x(Module* mod);
|
SX128x(Module* mod);
|
||||||
|
@ -369,84 +367,55 @@ class SX128x: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Initialization method for LoRa modem.
|
\brief Initialization method for LoRa modem.
|
||||||
|
|
||||||
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
||||||
|
|
||||||
\param bw LoRa bandwidth in kHz. Defaults to 812.5 kHz.
|
\param bw LoRa bandwidth in kHz. Defaults to 812.5 kHz.
|
||||||
|
|
||||||
\param sf LoRa spreading factor. Defaults to 9.
|
\param sf LoRa spreading factor. Defaults to 9.
|
||||||
|
|
||||||
\param cr LoRa coding rate denominator. Defaults to 7 (coding rate 4/7).
|
\param cr LoRa coding rate denominator. Defaults to 7 (coding rate 4/7).
|
||||||
|
|
||||||
\param syncWord 2-byte LoRa sync word. Defaults to RADIOLIB_SX128X_SYNC_WORD_PRIVATE (0x12).
|
\param syncWord 2-byte LoRa sync word. Defaults to RADIOLIB_SX128X_SYNC_WORD_PRIVATE (0x12).
|
||||||
|
\param pwr Output power in dBm. Defaults to 10 dBm.
|
||||||
\param power Output power in dBm. Defaults to 10 dBm.
|
|
||||||
|
|
||||||
\param preambleLength LoRa preamble length in symbols. Defaults to 12 symbols.
|
\param preambleLength LoRa preamble length in symbols. Defaults to 12 symbols.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t begin(float freq = 2400.0, float bw = 812.5, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = RADIOLIB_SX128X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 12);
|
int16_t begin(float freq = 2400.0, float bw = 812.5, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = RADIOLIB_SX128X_SYNC_WORD_PRIVATE, int8_t pwr = 10, uint16_t preambleLength = 12);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Initialization method for GFSK modem.
|
\brief Initialization method for GFSK modem.
|
||||||
|
|
||||||
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
||||||
|
|
||||||
\param br FSK bit rate in kbps. Defaults to 800 kbps.
|
\param br FSK bit rate in kbps. Defaults to 800 kbps.
|
||||||
|
|
||||||
\param freqDev Frequency deviation from carrier frequency in kHz. Defaults to 400.0 kHz.
|
\param freqDev Frequency deviation from carrier frequency in kHz. Defaults to 400.0 kHz.
|
||||||
|
\param pwr Output power in dBm. Defaults to 10 dBm.
|
||||||
\param power Output power in dBm. Defaults to 10 dBm.
|
|
||||||
|
|
||||||
\param preambleLength FSK preamble length in bits. Defaults to 16 bits.
|
\param preambleLength FSK preamble length in bits. Defaults to 16 bits.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t beginGFSK(float freq = 2400.0, uint16_t br = 800, float freqDev = 400.0, int8_t power = 10, uint16_t preambleLength = 16);
|
int16_t beginGFSK(float freq = 2400.0, uint16_t br = 800, float freqDev = 400.0, int8_t pwr = 10, uint16_t preambleLength = 16);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Initialization method for BLE modem.
|
\brief Initialization method for BLE modem.
|
||||||
|
|
||||||
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
||||||
|
|
||||||
\param br BLE bit rate in kbps. Defaults to 800 kbps.
|
\param br BLE bit rate in kbps. Defaults to 800 kbps.
|
||||||
|
|
||||||
\param freqDev Frequency deviation from carrier frequency in kHz. Defaults to 400.0 kHz.
|
\param freqDev Frequency deviation from carrier frequency in kHz. Defaults to 400.0 kHz.
|
||||||
|
\param pwr Output power in dBm. Defaults to 10 dBm.
|
||||||
\param power Output power in dBm. Defaults to 10 dBm.
|
|
||||||
|
|
||||||
\param dataShaping Time-bandwidth product of the Gaussian filter to be used for shaping. Defaults to 0.5.
|
\param dataShaping Time-bandwidth product of the Gaussian filter to be used for shaping. Defaults to 0.5.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t beginBLE(float freq = 2400.0, uint16_t br = 800, float freqDev = 400.0, int8_t power = 10, uint8_t dataShaping = RADIOLIB_SHAPING_0_5);
|
int16_t beginBLE(float freq = 2400.0, uint16_t br = 800, float freqDev = 400.0, int8_t pwr = 10, uint8_t dataShaping = RADIOLIB_SHAPING_0_5);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Initialization method for FLRC modem.
|
\brief Initialization method for FLRC modem.
|
||||||
|
|
||||||
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
\param freq Carrier frequency in MHz. Defaults to 2400.0 MHz.
|
||||||
|
|
||||||
\param br FLRC bit rate in kbps. Defaults to 650 kbps.
|
\param br FLRC bit rate in kbps. Defaults to 650 kbps.
|
||||||
|
|
||||||
\param cr FLRC coding rate. Defaults to 3 (coding rate 3/4).
|
\param cr FLRC coding rate. Defaults to 3 (coding rate 3/4).
|
||||||
|
\param pwr Output power in dBm. Defaults to 10 dBm.
|
||||||
\param power Output power in dBm. Defaults to 10 dBm.
|
|
||||||
|
|
||||||
\param preambleLength FLRC preamble length in bits. Defaults to 16 bits.
|
\param preambleLength FLRC preamble length in bits. Defaults to 16 bits.
|
||||||
|
|
||||||
\param dataShaping Time-bandwidth product of the Gaussian filter to be used for shaping. Defaults to 0.5.
|
\param dataShaping Time-bandwidth product of the Gaussian filter to be used for shaping. Defaults to 0.5.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t beginFLRC(float freq = 2400.0, uint16_t br = 650, uint8_t cr = 3, int8_t power = 10, uint16_t preambleLength = 16, uint8_t dataShaping = RADIOLIB_SHAPING_0_5);
|
int16_t beginFLRC(float freq = 2400.0, uint16_t br = 650, uint8_t cr = 3, int8_t pwr = 10, uint16_t preambleLength = 16, uint8_t dataShaping = RADIOLIB_SHAPING_0_5);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Reset method. Will reset the chip to the default state using RST pin.
|
\brief Reset method. Will reset the chip to the default state using RST pin.
|
||||||
|
|
||||||
\param verify Whether correct module startup should be verified. When set to true, RadioLib will attempt to verify the module has started correctly
|
\param verify Whether correct module startup should be verified. When set to true, RadioLib will attempt to verify the module has started correctly
|
||||||
by repeatedly issuing setStandby command. Enabled by default.
|
by repeatedly issuing setStandby command. Enabled by default.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t reset(bool verify = true);
|
int16_t reset(bool verify = true);
|
||||||
|
@ -454,13 +423,9 @@ class SX128x: public PhysicalLayer {
|
||||||
/*!
|
/*!
|
||||||
\brief Blocking binary transmit method.
|
\brief Blocking binary transmit method.
|
||||||
Overloads for string-based transmissions are implemented in PhysicalLayer.
|
Overloads for string-based transmissions are implemented in PhysicalLayer.
|
||||||
|
|
||||||
\param data Binary data to be sent.
|
\param data Binary data to be sent.
|
||||||
|
|
||||||
\param len Number of bytes to send.
|
\param len Number of bytes to send.
|
||||||
|
|
||||||
\param addr Address to send the data to. Unsupported, compatibility only.
|
\param addr Address to send the data to. Unsupported, compatibility only.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t transmit(uint8_t* data, size_t len, uint8_t addr = 0) override;
|
int16_t transmit(uint8_t* data, size_t len, uint8_t addr = 0) override;
|
||||||
|
@ -468,60 +433,50 @@ class SX128x: public PhysicalLayer {
|
||||||
/*!
|
/*!
|
||||||
\brief Blocking binary receive method.
|
\brief Blocking binary receive method.
|
||||||
Overloads for string-based transmissions are implemented in PhysicalLayer.
|
Overloads for string-based transmissions are implemented in PhysicalLayer.
|
||||||
|
|
||||||
\param data Binary data to be sent.
|
\param data Binary data to be sent.
|
||||||
|
|
||||||
\param len Number of bytes to send.
|
\param len Number of bytes to send.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t receive(uint8_t* data, size_t len) override;
|
int16_t receive(uint8_t* data, size_t len) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Starts direct mode transmission.
|
\brief Starts direct mode transmission.
|
||||||
|
|
||||||
\param frf Raw RF frequency value. Defaults to 0, required for quick frequency shifts in RTTY.
|
\param frf Raw RF frequency value. Defaults to 0, required for quick frequency shifts in RTTY.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t transmitDirect(uint32_t frf = 0) override;
|
int16_t transmitDirect(uint32_t frf = 0) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Starts direct mode reception. Only implemented for PhysicalLayer compatibility, as %SX128x series does not support direct mode reception.
|
\brief Starts direct mode reception. Only implemented for PhysicalLayer compatibility,
|
||||||
Will always return RADIOLIB_ERR_UNKNOWN.
|
as %SX128x series does not support direct mode reception. Will always return RADIOLIB_ERR_UNKNOWN.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t receiveDirect() override;
|
int16_t receiveDirect() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Performs scan for LoRa transmission in the current channel. Detects both preamble and payload.
|
\brief Performs scan for LoRa transmission in the current channel. Detects both preamble and payload.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t scanChannel();
|
int16_t scanChannel();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets the module to sleep mode.
|
\brief Sets the module to sleep mode.
|
||||||
|
\param retainConfig Set to true to retain configuration and data buffer or to false
|
||||||
\param retainConfig Set to true to retain configuration and data buffer or to false to discard current configuration and data buffer. Defaults to true.
|
to discard current configuration and data buffer. Defaults to true.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t sleep(bool retainConfig = true);
|
int16_t sleep(bool retainConfig = true);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets the module to standby mode (overload for PhysicalLayer compatibility, uses 13 MHz RC oscillator).
|
\brief Sets the module to standby mode (overload for PhysicalLayer compatibility, uses 13 MHz RC oscillator).
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t standby() override;
|
int16_t standby() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets the module to standby mode.
|
\brief Sets the module to standby mode.
|
||||||
|
\param mode Oscillator to be used in standby mode. Can be set to RADIOLIB_SX128X_STANDBY_RC
|
||||||
\param mode Oscillator to be used in standby mode. Can be set to RADIOLIB_SX128X_STANDBY_RC (13 MHz RC oscillator) or RADIOLIB_SX128X_STANDBY_XOSC (52 MHz external crystal oscillator).
|
(13 MHz RC oscillator) or RADIOLIB_SX128X_STANDBY_XOSC (52 MHz external crystal oscillator).
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t standby(uint8_t mode);
|
int16_t standby(uint8_t mode);
|
||||||
|
@ -530,7 +485,6 @@ class SX128x: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets interrupt service routine to call when DIO1 activates.
|
\brief Sets interrupt service routine to call when DIO1 activates.
|
||||||
|
|
||||||
\param func ISR to call.
|
\param func ISR to call.
|
||||||
*/
|
*/
|
||||||
void setDio1Action(void (*func)(void));
|
void setDio1Action(void (*func)(void));
|
||||||
|
@ -543,36 +497,29 @@ class SX128x: public PhysicalLayer {
|
||||||
/*!
|
/*!
|
||||||
\brief Interrupt-driven binary transmit method.
|
\brief Interrupt-driven binary transmit method.
|
||||||
Overloads for string-based transmissions are implemented in PhysicalLayer.
|
Overloads for string-based transmissions are implemented in PhysicalLayer.
|
||||||
|
|
||||||
\param data Binary data to be sent.
|
\param data Binary data to be sent.
|
||||||
|
|
||||||
\param len Number of bytes to send.
|
\param len Number of bytes to send.
|
||||||
|
|
||||||
\param addr Address to send the data to. Unsupported, compatibility only.
|
\param addr Address to send the data to. Unsupported, compatibility only.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t startTransmit(uint8_t* data, size_t len, uint8_t addr = 0) override;
|
int16_t startTransmit(uint8_t* data, size_t len, uint8_t addr = 0) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Clean up after transmission is done.
|
\brief Clean up after transmission is done.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t finishTransmit() override;
|
int16_t finishTransmit() override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Interrupt-driven receive method. DIO1 will be activated when full packet is received.
|
\brief Interrupt-driven receive method. DIO1 will be activated when full packet is received.
|
||||||
|
\param timeout Raw timeout value, expressed as multiples of 15.625 us. Defaults to
|
||||||
\param timeout Raw timeout value, expressed as multiples of 15.625 us. Defaults to RADIOLIB_SX128X_RX_TIMEOUT_INF for infinite timeout (Rx continuous mode), set to RADIOLIB_SX128X_RX_TIMEOUT_NONE for no timeout (Rx single mode).
|
RADIOLIB_SX128X_RX_TIMEOUT_INF for infinite timeout (Rx continuous mode),
|
||||||
|
set to RADIOLIB_SX128X_RX_TIMEOUT_NONE for no timeout (Rx single mode).
|
||||||
If timeout other than infinite is set, signal will be generated on DIO1.
|
If timeout other than infinite is set, signal will be generated on DIO1.
|
||||||
|
|
||||||
\param irqFlags Sets the IRQ flags, defaults to RADIOLIB_SX128X_IRQ_RX_DEFAULT.
|
\param irqFlags Sets the IRQ flags, defaults to RADIOLIB_SX128X_IRQ_RX_DEFAULT.
|
||||||
|
|
||||||
\param irqMask Sets the mask of IRQ flags that will trigger DIO1, defaults to RADIOLIB_SX128X_IRQ_RX_DONE.
|
\param irqMask Sets the mask of IRQ flags that will trigger DIO1, defaults to RADIOLIB_SX128X_IRQ_RX_DONE.
|
||||||
|
|
||||||
\param len Only for PhysicalLayer compatibility, not used.
|
\param len Only for PhysicalLayer compatibility, not used.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t startReceive(uint16_t timeout = RADIOLIB_SX128X_RX_TIMEOUT_INF, uint16_t irqFlags = RADIOLIB_SX128X_IRQ_RX_DEFAULT, uint16_t irqMask = RADIOLIB_SX128X_IRQ_RX_DONE, size_t len = 0);
|
int16_t startReceive(uint16_t timeout = RADIOLIB_SX128X_RX_TIMEOUT_INF, uint16_t irqFlags = RADIOLIB_SX128X_IRQ_RX_DEFAULT, uint16_t irqMask = RADIOLIB_SX128X_IRQ_RX_DONE, size_t len = 0);
|
||||||
|
@ -585,12 +532,9 @@ class SX128x: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Reads data received after calling startReceive method.
|
\brief Reads data received after calling startReceive method.
|
||||||
|
|
||||||
\param data Pointer to array to save the received binary data.
|
\param data Pointer to array to save the received binary data.
|
||||||
|
|
||||||
\param len Number of bytes that will be read. When set to 0, the packet length will be retreived automatically.
|
\param len Number of bytes that will be read. When set to 0, the packet length will be retreived automatically.
|
||||||
When more bytes than received are requested, only the number of bytes requested will be returned.
|
When more bytes than received are requested, only the number of bytes requested will be returned.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t readData(uint8_t* data, size_t len) override;
|
int16_t readData(uint8_t* data, size_t len) override;
|
||||||
|
@ -599,74 +543,59 @@ class SX128x: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets carrier frequency. Allowed values are in range from 2400.0 to 2500.0 MHz.
|
\brief Sets carrier frequency. Allowed values are in range from 2400.0 to 2500.0 MHz.
|
||||||
|
|
||||||
\param freq Carrier frequency to be set in MHz.
|
\param freq Carrier frequency to be set in MHz.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setFrequency(float freq);
|
int16_t setFrequency(float freq);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets LoRa bandwidth. Allowed values are 203.125, 406.25, 812.5 and 1625.0 kHz.
|
\brief Sets LoRa bandwidth. Allowed values are 203.125, 406.25, 812.5 and 1625.0 kHz.
|
||||||
|
|
||||||
\param bw LoRa bandwidth to be set in kHz.
|
\param bw LoRa bandwidth to be set in kHz.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setBandwidth(float bw);
|
int16_t setBandwidth(float bw);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets LoRa spreading factor. Allowed values range from 5 to 12.
|
\brief Sets LoRa spreading factor. Allowed values range from 5 to 12.
|
||||||
|
|
||||||
\param sf LoRa spreading factor to be set.
|
\param sf LoRa spreading factor to be set.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setSpreadingFactor(uint8_t sf);
|
int16_t setSpreadingFactor(uint8_t sf);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets LoRa coding rate denominator. Allowed values range from 5 to 8.
|
\brief Sets LoRa coding rate denominator. Allowed values range from 5 to 8.
|
||||||
|
|
||||||
\param cr LoRa coding rate denominator to be set.
|
\param cr LoRa coding rate denominator to be set.
|
||||||
|
\param longInterleaving Whether to enable long interleaving mode. Not available for coding rate 4/7,
|
||||||
\param longInterleaving Whether to enable long interleaving mode. Not available for coding rate 4/7, defaults to false.
|
defaults to false.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setCodingRate(uint8_t cr, bool longInterleaving = false);
|
int16_t setCodingRate(uint8_t cr, bool longInterleaving = false);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets output power. Allowed values are in range from -18 to 13 dBm.
|
\brief Sets output power. Allowed values are in range from -18 to 13 dBm.
|
||||||
|
\param pwr Output power to be set in dBm.
|
||||||
\param power Output power to be set in dBm.
|
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setOutputPower(int8_t power);
|
int16_t setOutputPower(int8_t pwr);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets preamble length for currently active modem. Allowed values range from 1 to 65535.
|
\brief Sets preamble length for currently active modem. Allowed values range from 1 to 65535.
|
||||||
|
|
||||||
\param preambleLength Preamble length to be set in symbols (LoRa) or bits (FSK/BLE/FLRC).
|
\param preambleLength Preamble length to be set in symbols (LoRa) or bits (FSK/BLE/FLRC).
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setPreambleLength(uint32_t preambleLength);
|
int16_t setPreambleLength(uint32_t preambleLength);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets FSK or FLRC bit rate. Allowed values are 125, 250, 400, 500, 800, 1000, 1600 and 2000 kbps (for FSK modem) or 260, 325, 520, 650, 1000 and 1300 (for FLRC modem).
|
\brief Sets FSK or FLRC bit rate. Allowed values are 125, 250, 400, 500, 800, 1000,
|
||||||
|
1600 and 2000 kbps (for FSK modem) or 260, 325, 520, 650, 1000 and 1300 (for FLRC modem).
|
||||||
\param br FSK/FLRC bit rate to be set in kbps.
|
\param br FSK/FLRC bit rate to be set in kbps.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setBitRate(float br);
|
int16_t setBitRate(float br);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets FSK frequency deviation. Allowed values range from 0.0 to 3200.0 kHz.
|
\brief Sets FSK frequency deviation. Allowed values range from 0.0 to 3200.0 kHz.
|
||||||
|
|
||||||
\param freqDev FSK frequency deviation to be set in kHz.
|
\param freqDev FSK frequency deviation to be set in kHz.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setFrequencyDeviation(float freqDev) override;
|
int16_t setFrequencyDeviation(float freqDev) override;
|
||||||
|
@ -674,144 +603,113 @@ class SX128x: public PhysicalLayer {
|
||||||
/*!
|
/*!
|
||||||
\brief Sets time-bandwidth product of Gaussian filter applied for shaping.
|
\brief Sets time-bandwidth product of Gaussian filter applied for shaping.
|
||||||
Allowed values are RADIOLIB_SHAPING_0_5 or RADIOLIB_SHAPING_1_0. Set to RADIOLIB_SHAPING_NONE to disable data shaping.
|
Allowed values are RADIOLIB_SHAPING_0_5 or RADIOLIB_SHAPING_1_0. Set to RADIOLIB_SHAPING_NONE to disable data shaping.
|
||||||
|
|
||||||
\param sh Time-bandwidth product of Gaussian filter to be set.
|
\param sh Time-bandwidth product of Gaussian filter to be set.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setDataShaping(uint8_t sh) override;
|
int16_t setDataShaping(uint8_t sh) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets FSK/FLRC sync word in the form of array of up to 5 bytes (FSK). For FLRC modem, the sync word must be exactly 4 bytes long
|
\brief Sets FSK/FLRC sync word in the form of array of up to 5 bytes (FSK). For FLRC modem,
|
||||||
|
the sync word must be exactly 4 bytes long
|
||||||
\param syncWord Sync word to be set.
|
\param syncWord Sync word to be set.
|
||||||
|
|
||||||
\param len Sync word length in bytes.
|
\param len Sync word length in bytes.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setSyncWord(uint8_t* syncWord, uint8_t len);
|
int16_t setSyncWord(uint8_t* syncWord, uint8_t len);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets LoRa sync word.
|
\brief Sets LoRa sync word.
|
||||||
|
|
||||||
\param syncWord LoRa sync word to be set.
|
\param syncWord LoRa sync word to be set.
|
||||||
|
|
||||||
\param controlBits Undocumented control bits, required for compatibility purposes.
|
\param controlBits Undocumented control bits, required for compatibility purposes.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setSyncWord(uint8_t syncWord, uint8_t controlBits = 0x44);
|
int16_t setSyncWord(uint8_t syncWord, uint8_t controlBits = 0x44);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets CRC configuration.
|
\brief Sets CRC configuration.
|
||||||
|
|
||||||
\param len CRC length in bytes, Allowed values are 1, 2 or 3, set to 0 to disable CRC.
|
\param len CRC length in bytes, Allowed values are 1, 2 or 3, set to 0 to disable CRC.
|
||||||
|
|
||||||
\param initial Initial CRC value. Defaults to 0x1D0F (CCIT CRC), not available for LoRa modem.
|
\param initial Initial CRC value. Defaults to 0x1D0F (CCIT CRC), not available for LoRa modem.
|
||||||
|
|
||||||
\param polynomial Polynomial for CRC calculation. Defaults to 0x1021 (CCIT CRC), not available for LoRa or BLE modem.
|
\param polynomial Polynomial for CRC calculation. Defaults to 0x1021 (CCIT CRC), not available for LoRa or BLE modem.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setCRC(uint8_t len, uint32_t initial = 0x1D0F, uint16_t polynomial = 0x1021);
|
int16_t setCRC(uint8_t len, uint32_t initial = 0x1D0F, uint16_t polynomial = 0x1021);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets whitening parameters, not available for LoRa or FLRC modem.
|
\brief Sets whitening parameters, not available for LoRa or FLRC modem.
|
||||||
|
|
||||||
\param enabled Set to true to enable whitening.
|
\param enabled Set to true to enable whitening.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setWhitening(bool enabled);
|
int16_t setWhitening(bool enabled);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets BLE access address.
|
\brief Sets BLE access address.
|
||||||
|
|
||||||
\param addr BLE access address.
|
\param addr BLE access address.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setAccessAddress(uint32_t addr);
|
int16_t setAccessAddress(uint32_t addr);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Enables or disables receiver high sensitivity mode.
|
\brief Enables or disables receiver high sensitivity mode.
|
||||||
|
\param enable True to enable and false to disable.
|
||||||
\param True to enable and false to disable.
|
\returns \ref status_codes
|
||||||
|
|
||||||
\returns 0
|
|
||||||
*/
|
*/
|
||||||
int16_t setHighSensitivityMode(bool hsm = false);
|
int16_t setHighSensitivityMode(bool enable);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Enables or disables receiver manual gain control.
|
\brief Enables or disables receiver manual gain control.
|
||||||
|
|
||||||
\param gain Use 0 for automatic gain, 1 for minimum gain and up to 13 for maximum gain.
|
\param gain Use 0 for automatic gain, 1 for minimum gain and up to 13 for maximum gain.
|
||||||
|
\returns \ref status_codes
|
||||||
\returns 0
|
|
||||||
*/
|
*/
|
||||||
int16_t setGainControl(uint8_t gain = 0);
|
int16_t setGainControl(uint8_t gain = 0);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Gets RSSI (Recorded Signal Strength Indicator) of the last received packet.
|
\brief Gets RSSI (Recorded Signal Strength Indicator) of the last received packet.
|
||||||
|
|
||||||
\returns RSSI of the last received packet in dBm.
|
\returns RSSI of the last received packet in dBm.
|
||||||
*/
|
*/
|
||||||
float getRSSI();
|
float getRSSI();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Gets SNR (Signal to Noise Ratio) of the last received packet. Only available for LoRa or ranging modem.
|
\brief Gets SNR (Signal to Noise Ratio) of the last received packet. Only available for LoRa or ranging modem.
|
||||||
|
|
||||||
\returns SNR of the last received packet in dB.
|
\returns SNR of the last received packet in dB.
|
||||||
*/
|
*/
|
||||||
float getSNR();
|
float getSNR();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Gets frequency error of the latest received packet.
|
\brief Gets frequency error of the latest received packet.
|
||||||
|
|
||||||
\returns Frequency error in Hz.
|
\returns Frequency error in Hz.
|
||||||
*/
|
*/
|
||||||
float getFrequencyError();
|
float getFrequencyError();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Query modem for the packet length of received payload.
|
\brief Query modem for the packet length of received payload.
|
||||||
|
|
||||||
\param update Update received packet length. Will return cached value when set to false.
|
\param update Update received packet length. Will return cached value when set to false.
|
||||||
|
|
||||||
\returns Length of last received packet in bytes.
|
\returns Length of last received packet in bytes.
|
||||||
*/
|
*/
|
||||||
size_t getPacketLength(bool update = true) override;
|
size_t getPacketLength(bool update = true) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get expected time-on-air for a given size of payload.
|
\brief Get expected time-on-air for a given size of payload.
|
||||||
|
|
||||||
\param len Payload length in bytes.
|
\param len Payload length in bytes.
|
||||||
|
|
||||||
\returns Expected time-on-air in microseconds.
|
\returns Expected time-on-air in microseconds.
|
||||||
*/
|
*/
|
||||||
uint32_t getTimeOnAir(size_t len);
|
uint32_t getTimeOnAir(size_t len);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set implicit header mode for future reception/transmission.
|
\brief Set implicit header mode for future reception/transmission.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t implicitHeader(size_t len);
|
int16_t implicitHeader(size_t len);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set explicit header mode for future reception/transmission.
|
\brief Set explicit header mode for future reception/transmission.
|
||||||
|
|
||||||
\param len Payload length in bytes.
|
\param len Payload length in bytes.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t explicitHeader();
|
int16_t explicitHeader();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets transmission encoding. Serves only as alias for PhysicalLayer compatibility.
|
\brief Sets transmission encoding. Serves only as alias for PhysicalLayer compatibility.
|
||||||
|
|
||||||
\param encoding Encoding to be used. Set to 0 for NRZ, and 2 for whitening.
|
\param encoding Encoding to be used. Set to 0 for NRZ, and 2 for whitening.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setEncoding(uint8_t encoding) override;
|
int16_t setEncoding(uint8_t encoding) override;
|
||||||
|
@ -824,31 +722,26 @@ class SX128x: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Dummy random method, to ensure PhysicalLayer compatibility.
|
\brief Dummy random method, to ensure PhysicalLayer compatibility.
|
||||||
|
|
||||||
\returns Always returns 0.
|
\returns Always returns 0.
|
||||||
*/
|
*/
|
||||||
uint8_t randomByte();
|
uint8_t randomByte();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Enable/disable inversion of the I and Q signals
|
\brief Enable/disable inversion of the I and Q signals
|
||||||
|
\param enable QI inversion enabled (true) or disabled (false);
|
||||||
\param invertIQ QI inversion enabled (true) or disabled (false);
|
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t invertIQ(bool invertIQ);
|
int16_t invertIQ(bool enable);
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE)
|
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE)
|
||||||
/*!
|
/*!
|
||||||
\brief Dummy method, to ensure PhysicalLayer compatibility.
|
\brief Dummy method, to ensure PhysicalLayer compatibility.
|
||||||
|
|
||||||
\param func Ignored.
|
\param func Ignored.
|
||||||
*/
|
*/
|
||||||
void setDirectAction(void (*func)(void));
|
void setDirectAction(void (*func)(void));
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Dummy method, to ensure PhysicalLayer compatibility.
|
\brief Dummy method, to ensure PhysicalLayer compatibility.
|
||||||
|
|
||||||
\param pin Ignored.
|
\param pin Ignored.
|
||||||
*/
|
*/
|
||||||
void readBit(uint32_t pin);
|
void readBit(uint32_t pin);
|
||||||
|
@ -857,16 +750,16 @@ class SX128x: public PhysicalLayer {
|
||||||
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
|
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
|
||||||
protected:
|
protected:
|
||||||
#endif
|
#endif
|
||||||
Module* _mod;
|
Module* mod;
|
||||||
|
|
||||||
#if !defined(RADIOLIB_GODMODE)
|
#if !defined(RADIOLIB_GODMODE)
|
||||||
protected:
|
protected:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// cached LoRa parameters
|
// cached LoRa parameters
|
||||||
float _bwKhz = 0;
|
float bandwidthKhz = 0;
|
||||||
uint8_t _bw = 0, _sf = 0, _cr = 0;
|
uint8_t bandwidth = 0, spreadingFactor = 0, codingRateLoRa = 0;
|
||||||
uint8_t _preambleLengthLoRa = 0, _headerType = 0, _payloadLen = 0, _crcLoRa = 0;
|
uint8_t preambleLengthLoRa = 0, headerType = 0, payloadLen = 0, crcLoRa = 0;
|
||||||
|
|
||||||
// SX128x SPI command implementations
|
// SX128x SPI command implementations
|
||||||
uint8_t getStatus();
|
uint8_t getStatus();
|
||||||
|
@ -879,18 +772,18 @@ class SX128x: public PhysicalLayer {
|
||||||
int16_t setCad();
|
int16_t setCad();
|
||||||
uint8_t getPacketType();
|
uint8_t getPacketType();
|
||||||
int16_t setRfFrequency(uint32_t frf);
|
int16_t setRfFrequency(uint32_t frf);
|
||||||
int16_t setTxParams(uint8_t power, uint8_t rampTime = RADIOLIB_SX128X_PA_RAMP_10_US);
|
int16_t setTxParams(uint8_t pwr, uint8_t rampTime = RADIOLIB_SX128X_PA_RAMP_10_US);
|
||||||
int16_t setBufferBaseAddress(uint8_t txBaseAddress = 0x00, uint8_t rxBaseAddress = 0x00);
|
int16_t setBufferBaseAddress(uint8_t txBaseAddress = 0x00, uint8_t rxBaseAddress = 0x00);
|
||||||
int16_t setModulationParams(uint8_t modParam1, uint8_t modParam2, uint8_t modParam3);
|
int16_t setModulationParams(uint8_t modParam1, uint8_t modParam2, uint8_t modParam3);
|
||||||
int16_t setPacketParamsGFSK(uint8_t preambleLen, uint8_t syncWordLen, uint8_t syncWordMatch, uint8_t crcLen, uint8_t whitening, uint8_t payloadLen = 0xFF, uint8_t headerType = RADIOLIB_SX128X_GFSK_FLRC_PACKET_VARIABLE);
|
int16_t setPacketParamsGFSK(uint8_t preambleLen, uint8_t syncLen, uint8_t syncMatch, uint8_t crcLen, uint8_t whiten, uint8_t payLen = 0xFF, uint8_t hdrType = RADIOLIB_SX128X_GFSK_FLRC_PACKET_VARIABLE);
|
||||||
int16_t setPacketParamsBLE(uint8_t connState, uint8_t crcLen, uint8_t bleTestPayload, uint8_t whitening);
|
int16_t setPacketParamsBLE(uint8_t connState, uint8_t crcLen, uint8_t bleTest, uint8_t whiten);
|
||||||
int16_t setPacketParamsLoRa(uint8_t preambleLen, uint8_t headerType, uint8_t payloadLen, uint8_t crc, uint8_t invertIQ = RADIOLIB_SX128X_LORA_IQ_STANDARD);
|
int16_t setPacketParamsLoRa(uint8_t preambleLen, uint8_t hdrType, uint8_t payLen, uint8_t crc, uint8_t invIQ = RADIOLIB_SX128X_LORA_IQ_STANDARD);
|
||||||
int16_t setDioIrqParams(uint16_t irqMask, uint16_t dio1Mask, uint16_t dio2Mask = RADIOLIB_SX128X_IRQ_NONE, uint16_t dio3Mask = RADIOLIB_SX128X_IRQ_NONE);
|
int16_t setDioIrqParams(uint16_t irqMask, uint16_t dio1Mask, uint16_t dio2Mask = RADIOLIB_SX128X_IRQ_NONE, uint16_t dio3Mask = RADIOLIB_SX128X_IRQ_NONE);
|
||||||
int16_t clearIrqStatus(uint16_t clearIrqParams = RADIOLIB_SX128X_IRQ_ALL);
|
int16_t clearIrqStatus(uint16_t clearIrqParams = RADIOLIB_SX128X_IRQ_ALL);
|
||||||
int16_t setRangingRole(uint8_t role);
|
int16_t setRangingRole(uint8_t role);
|
||||||
int16_t setPacketType(uint8_t type);
|
int16_t setPacketType(uint8_t type);
|
||||||
|
|
||||||
int16_t setHeaderType(uint8_t headerType, size_t len = 0xFF);
|
int16_t setHeaderType(uint8_t hdrType, size_t len = 0xFF);
|
||||||
|
|
||||||
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
|
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
|
||||||
private:
|
private:
|
||||||
|
@ -903,22 +796,22 @@ class SX128x: public PhysicalLayer {
|
||||||
private:
|
private:
|
||||||
#endif
|
#endif
|
||||||
// common parameters
|
// common parameters
|
||||||
uint8_t _pwr = 0;
|
uint8_t power = 0;
|
||||||
|
|
||||||
// cached LoRa parameters
|
// cached LoRa parameters
|
||||||
uint8_t _invertIQ = RADIOLIB_SX128X_LORA_IQ_STANDARD;
|
uint8_t invertIQEnabled = RADIOLIB_SX128X_LORA_IQ_STANDARD;
|
||||||
|
|
||||||
// cached GFSK parameters
|
// cached GFSK parameters
|
||||||
float _modIndexReal = 0;
|
float modIndexReal = 0;
|
||||||
uint16_t _brKbps = 0;
|
uint16_t bitRateKbps = 0;
|
||||||
uint8_t _br = 0, _modIndex = 0, _shaping = 0;
|
uint8_t bitRate = 0, modIndex = 0, shaping = 0;
|
||||||
uint8_t _preambleLengthGFSK = 0, _syncWordLen = 0, _syncWordMatch = 0, _crcGFSK = 0, _whitening = 0;
|
uint8_t preambleLengthGFSK = 0, syncWordLen = 0, syncWordMatch = 0, crcGFSK = 0, whitening = 0;
|
||||||
|
|
||||||
// cached FLRC parameters
|
// cached FLRC parameters
|
||||||
uint8_t _crFLRC = 0;
|
uint8_t codingRateFLRC = 0;
|
||||||
|
|
||||||
// cached BLE parameters
|
// cached BLE parameters
|
||||||
uint8_t _connectionState = 0, _crcBLE = 0, _bleTestPayload = 0;
|
uint8_t connectionState = 0, crcBLE = 0, bleTestPayload = 0;
|
||||||
|
|
||||||
int16_t config(uint8_t modem);
|
int16_t config(uint8_t modem);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue