[Si443x] Implemented RF switch control
This commit is contained in:
parent
0f287a53e7
commit
d1527b0d8c
2 changed files with 20 additions and 0 deletions
|
@ -222,6 +222,9 @@ int16_t Si443x::startTransmit(uint8_t* data, size_t len, uint8_t addr) {
|
||||||
// write packet to FIFO
|
// write packet to FIFO
|
||||||
_mod->SPIwriteRegisterBurst(SI443X_REG_FIFO_ACCESS, data, len);
|
_mod->SPIwriteRegisterBurst(SI443X_REG_FIFO_ACCESS, data, len);
|
||||||
|
|
||||||
|
// set RF switch (if present)
|
||||||
|
_mod->setRfSwitchState(true);
|
||||||
|
|
||||||
// set mode to transmit
|
// set mode to transmit
|
||||||
_mod->SPIwriteRegister(SI443X_REG_OP_FUNC_CONTROL_1, SI443X_TX_ON);
|
_mod->SPIwriteRegister(SI443X_REG_OP_FUNC_CONTROL_1, SI443X_TX_ON);
|
||||||
|
|
||||||
|
@ -246,6 +249,9 @@ int16_t Si443x::startReceive() {
|
||||||
// clear interrupt flags
|
// clear interrupt flags
|
||||||
clearIRQFlags();
|
clearIRQFlags();
|
||||||
|
|
||||||
|
// set RF switch (if present)
|
||||||
|
_mod->setRfSwitchState(false);
|
||||||
|
|
||||||
// set mode to receive
|
// set mode to receive
|
||||||
_mod->SPIwriteRegister(SI443X_REG_OP_FUNC_CONTROL_1, SI443X_RX_ON);
|
_mod->SPIwriteRegister(SI443X_REG_OP_FUNC_CONTROL_1, SI443X_RX_ON);
|
||||||
|
|
||||||
|
@ -504,6 +510,10 @@ int16_t Si443x::setDataShaping(float sh) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Si443x::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
||||||
|
_mod->setRfSwitchPins(rxEn, txEn);
|
||||||
|
}
|
||||||
|
|
||||||
int16_t Si443x::setFrequencyRaw(float newFreq) {
|
int16_t Si443x::setFrequencyRaw(float newFreq) {
|
||||||
// set mode to standby
|
// set mode to standby
|
||||||
int16_t state = standby();
|
int16_t state = standby();
|
||||||
|
|
|
@ -760,6 +760,16 @@ class Si443x: public PhysicalLayer {
|
||||||
*/
|
*/
|
||||||
int16_t setDataShaping(float sh);
|
int16_t setDataShaping(float sh);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Some modules contain external RF switch controlled by two pins. This function gives RadioLib control over those two pins to automatically switch Rx and Tx state.
|
||||||
|
When using automatic RF switch control, DO NOT change the pin mode of rxEn or txEn from Arduino sketch!
|
||||||
|
|
||||||
|
\param rxEn RX enable pin.
|
||||||
|
|
||||||
|
\param txEn TX enable pin.
|
||||||
|
*/
|
||||||
|
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||||
|
|
||||||
#ifndef RADIOLIB_GODMODE
|
#ifndef RADIOLIB_GODMODE
|
||||||
protected:
|
protected:
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue