[SX1278] Added method to control InvertIQ
This commit is contained in:
parent
1bceb90d42
commit
6fdf3feef7
3 changed files with 30 additions and 0 deletions
|
@ -131,6 +131,7 @@ setRfSwitchPins KEYWORD2
|
|||
forceLDRO KEYWORD2
|
||||
autoLDRO KEYWORD2
|
||||
getChipVersion KEYWORD2
|
||||
invertIQ KEYWORD2
|
||||
|
||||
# RF69-specific
|
||||
setAESKey KEYWORD2
|
||||
|
|
|
@ -538,6 +538,22 @@ int16_t SX1278::setHeaderType(uint8_t headerType, size_t len) {
|
|||
return(state);
|
||||
}
|
||||
|
||||
int16_t SX1278::invertIQ(bool invertIQ) {
|
||||
// check active modem
|
||||
if(getActiveModem() != SX127X_LORA) {
|
||||
return(ERR_WRONG_MODEM);
|
||||
}
|
||||
|
||||
int16_t state;
|
||||
if(invertIQ) {
|
||||
state = _mod->SPIsetRegValue(SX127X_REG_INVERT_IQ, SX127X_REG_INVERT_IQ_ON, 6, 6);
|
||||
} else {
|
||||
state = _mod->SPIsetRegValue(SX127X_REG_INVERT_IQ, SX127X_REG_INVERT_IQ_OFF, 6, 6);
|
||||
}
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
||||
int16_t SX1278::configFSK() {
|
||||
// configure common registers
|
||||
int16_t state = SX127x::configFSK();
|
||||
|
|
|
@ -66,6 +66,10 @@
|
|||
#define SX1278_AGC_AUTO_OFF 0b00000000 // 2 2 LNA gain set by REG_LNA
|
||||
#define SX1278_AGC_AUTO_ON 0b00000100 // 2 2 LNA gain set by internal AGC loop
|
||||
|
||||
// SX127X_REG_INVERT_IQ
|
||||
#define SX127X_REG_INVERT_IQ_ON 0b01000000 // 6 6 I and Q signals are inverted
|
||||
#define SX127X_REG_INVERT_IQ_OFF 0b00000000 // 6 6 normal mode
|
||||
|
||||
// SX127X_REG_VERSION
|
||||
#define SX1278_CHIP_VERSION 0x12
|
||||
|
||||
|
@ -295,6 +299,15 @@ class SX1278: public SX127x {
|
|||
*/
|
||||
int16_t explicitHeader();
|
||||
|
||||
/*!
|
||||
\brief Enables/disables Invert the LoRa I and Q signals.
|
||||
|
||||
\param invertIQ Enable (true) or disable (false) LoRa I and Q signals.
|
||||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t invertIQ(bool invertIQ);
|
||||
|
||||
#ifndef RADIOLIB_GODMODE
|
||||
protected:
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue