[SX126x] Added option to set LoRa sync word control bits
This commit is contained in:
parent
c40f382ed6
commit
d892320637
2 changed files with 5 additions and 3 deletions
|
@ -633,14 +633,14 @@ int16_t SX126x::setCodingRate(uint8_t cr) {
|
|||
return(setModulationParams(_sf, _bw, _cr));
|
||||
}
|
||||
|
||||
int16_t SX126x::setSyncWord(uint8_t syncWord) {
|
||||
int16_t SX126x::setSyncWord(uint8_t syncWord, uint8_t controlBits) {
|
||||
// check active modem
|
||||
if(getPacketType() != SX126X_PACKET_TYPE_LORA) {
|
||||
return(ERR_WRONG_MODEM);
|
||||
}
|
||||
|
||||
// update register
|
||||
uint8_t data[2] = {(uint8_t)((syncWord & 0xF0) | 0x04), (uint8_t)(((syncWord & 0x0F) << 4) | 0x04)};
|
||||
uint8_t data[2] = {(uint8_t)((syncWord & 0xF0) | ((controlBits & 0xF0) >> 4)), (uint8_t)(((syncWord & 0x0F) << 4) | (controlBits & 0x0F))};
|
||||
return(writeRegister(SX126X_REG_LORA_SYNC_WORD_MSB, data, 2));
|
||||
}
|
||||
|
||||
|
|
|
@ -586,9 +586,11 @@ class SX126x: public PhysicalLayer {
|
|||
|
||||
\param syncWord LoRa sync word to be set.
|
||||
|
||||
\param controlBits Undocumented control bits, required for compatibility purposes.
|
||||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setSyncWord(uint8_t syncWord);
|
||||
int16_t setSyncWord(uint8_t syncWord, uint8_t controlBits = 0x44);
|
||||
|
||||
/*!
|
||||
\brief Sets current protection limit. Can be set in 0.25 mA steps.
|
||||
|
|
Loading…
Add table
Reference in a new issue