kopia lustrzana https://github.com/jgromes/RadioLib
[SX126x] Add support for coding rate 4/4
rodzic
b7fbf2fc23
commit
1578671e9b
|
@ -151,7 +151,7 @@ int16_t LLCC68::checkDataRate(DataRate_t dr) {
|
|||
|
||||
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_LORA) {
|
||||
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 100.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
|
||||
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
|
||||
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 4, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
|
||||
uint8_t bw_div2 = dr.lora.bandwidth / 2 + 0.01f;
|
||||
switch (bw_div2) {
|
||||
case 62: // 125.0:
|
||||
|
|
|
@ -29,7 +29,8 @@ class LLCC68: public SX1262 {
|
|||
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
|
||||
\param bw LoRa bandwidth in kHz. Defaults to 125.0 kHz.
|
||||
\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). Allowed values range from 4 to 8. Note that a value of 4 means no coding,
|
||||
is undocumented and not recommended without your own FEC.
|
||||
\param syncWord 1-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12).
|
||||
\param pwr Output power in dBm. Defaults to 10 dBm.
|
||||
\param preambleLength LoRa preamble length in symbols. Defaults to 8 symbols.
|
||||
|
|
|
@ -34,7 +34,8 @@ class SX1262: public SX126x {
|
|||
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
|
||||
\param bw LoRa bandwidth in kHz. Defaults to 125.0 kHz.
|
||||
\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). Allowed values range from 4 to 8. Note that a value of 4 means no coding,
|
||||
is undocumented and not recommended without your own FEC.
|
||||
\param syncWord 1-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12).
|
||||
\param power Output power in dBm. Defaults to 10 dBm.
|
||||
\param preambleLength LoRa preamble length in symbols. Defaults to 8 symbols.
|
||||
|
|
|
@ -33,7 +33,8 @@ class SX1268: public SX126x {
|
|||
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
|
||||
\param bw LoRa bandwidth in kHz. Defaults to 125.0 kHz.
|
||||
\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). Allowed values range from 4 to 8.
|
||||
Note that a value of 4 means no coding, is undocumented and not recommended without your own FEC.
|
||||
\param syncWord 1-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12).
|
||||
\param power Output power in dBm. Defaults to 10 dBm.
|
||||
\param preambleLength LoRa preamble length in symbols. Defaults to 8 symbols.
|
||||
|
|
|
@ -801,7 +801,7 @@ int16_t SX126x::setCodingRate(uint8_t cr) {
|
|||
return(RADIOLIB_ERR_WRONG_MODEM);
|
||||
}
|
||||
|
||||
RADIOLIB_CHECK_RANGE(cr, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
|
||||
RADIOLIB_CHECK_RANGE(cr, 4, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
|
||||
|
||||
// update modulation parameters
|
||||
this->codingRate = cr - 4;
|
||||
|
@ -958,7 +958,7 @@ int16_t SX126x::checkDataRate(DataRate_t dr) {
|
|||
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_LORA) {
|
||||
RADIOLIB_CHECK_RANGE(dr.lora.spreadingFactor, 5, 12, RADIOLIB_ERR_INVALID_SPREADING_FACTOR);
|
||||
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 0.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
|
||||
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
|
||||
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 4, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
|
||||
return(RADIOLIB_ERR_NONE);
|
||||
|
||||
}
|
||||
|
|
|
@ -501,7 +501,8 @@ class SX126x: public PhysicalLayer {
|
|||
|
||||
/*!
|
||||
\brief Initialization method for LoRa modem.
|
||||
\param cr LoRa coding rate denominator. Allowed values range from 5 to 8.
|
||||
\param cr LoRa coding rate denominator. Allowed values range from 4 to 8. Note that a value of 4 means no coding,
|
||||
is undocumented and not recommended without your own FEC.
|
||||
\param syncWord 1-byte LoRa sync word.
|
||||
\param preambleLength LoRa preamble length in symbols. Allowed values range from 1 to 65535.
|
||||
\param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip.
|
||||
|
@ -774,7 +775,8 @@ class SX126x: public PhysicalLayer {
|
|||
virtual 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 4 to 8. Note that a value of 4 means no coding,
|
||||
is undocumented and not recommended without your own FEC.
|
||||
\param cr LoRa coding rate denominator to be set.
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
|
|
Ładowanie…
Reference in New Issue